________________________
A transport Company charges for parcels as per the following tariff:
Weight Charges
Upto 10kg Rs.30 per kg
For the next 20kg Rs.20 per kg
Above 30kg Rs.15 per unit
Write a program in Java to calculate the charge for a parcel, taking the weight of the parcel as an input.
________________________
Answers
Answered by
5
Explanation:
import java.util.Scanner; public class KboatMayurTpt { public static void main(String args[]) { Scanner in =
new Scanner(System.in); System.out.print("Enter parcel weight: "); double wt = in.nextDouble(); double amt = 0; if (wt <= 10) amt = 30 * wt; else if (wt <= 30) amt = 300 + ((wt - 10) * 20); else amt = 300 + 400 + ((wt - 30) * 15); System.out.println("Parcel Charge = " + amt); }
__________________________________________
hope it is helpful to you and mark me as a brainlist friend
Attachments:
![](https://hi-static.z-dn.net/files/de7/23de18c5d33fd775664435ff78fa3c4b.jpg)
Answered by
2
________________________hope it will be helpful_______________
Attachments:
![](https://hi-static.z-dn.net/files/d02/717084d0e01b229f1c5c2812cf9a50d5.jpg)
Similar questions
Physics,
2 months ago
Math,
2 months ago
Math,
5 months ago
Social Sciences,
1 year ago
Biology,
1 year ago