________________________
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:
Answered by
2
________________________hope it will be helpful_______________
Attachments:
Similar questions
Math,
2 months ago
Computer Science,
2 months ago
Math,
4 months ago
Social Sciences,
10 months ago
Biology,
10 months ago
Chemistry,
10 months ago