Computer Science, asked by hari5719, 1 year ago

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 ?\
danishjoshi111: c/c++
hari5719: no u can do in pesudocode  
hari5719: or java 
danishjoshi111: kk i am writing
hari5719: k.
hari5719: thats it ??
danishjoshi111: i think so :: first the program looks for an input . if the input is less than or equal to 100 it print the cost as 80 . if the cost is graeter than 100 it prints the answer as 40
hari5719: thx

Answers

Answered by danishjoshi111
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); } }

hari5719: is that it ???
Similar questions