Project: Create a program in Python to calculate charges for a parcel by taking input. Mayor Transport Company charges for a parcel as per the following tariff WEIGHT CHARGES APPLIED Rs 15 per kg Less than 10kg Between 10kg to 20kg Above 20kg Rs 25 per kg Rs 35 per kg weight of a parcel as
Softwares Required: IDLE
Answers
Answered by
1
Answer:
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);
}
}
Explanation:
Similar questions