Saved Bookmarks
| 1. |
Write a java program to calculate charge for sending parcel.For 1st kg - Rs 30Thereafter for every 500 gm or its fraction - Rs 10 |
|
Answer» IMPORT java.util.* CLASS Parcel { BufferedReader br= new BufferedReader ( new InputStreamReader (System.in)); PUBLIC void calc()throws IOException { double bill,x; System.out.println("Enter the WEIGHT of the parcel"); x=Double.parseDouble(br.readline()); if (x==1.0) bill=30 else bill=30+((x-1)/2)*10; System.out.println("bill AMOUNT:"bill); } } |
|