A courier service provides a speed service for any letter/ parcel to new york which delivers on the
same day as per the rate given below: Write an algorithm/program to input the parcel weight in
grams and calculate and print the total charge for a parcel.
Up to 100 gms: Rs. 80
For each additional 100 gm or part thereof Rs. 40
Eg., sample input : 320 gm.
Charge : up to 100 gms =Rs.80
For next 200 gms = Rs. 80
For 20 gms = Rs.40
Total charge = Rs.200
danishjoshi111:
language ?\
Answers
Answered by
6
class courier {
public static void main(String[] args) {
int input;
char grade;
if (input <= 100) {
price = '80'; }
else if (input > 100) {
price = '40'; }
else { price = 'Error'; }
System.out.println("Price = " + price); } }
int input;
char grade;
if (input <= 100) {
price = '80'; }
else if (input > 100) {
price = '40'; }
else { price = 'Error'; }
System.out.println("Price = " + price); } }
Similar questions