Write a java program To calculate and return the service charge for the
transportation of any parcel according to the following criteria:
upto 100 gms = Rs 40 for each additional 50 gm or part thereof =Rs 20
Answers
Answered by
1
Answer:
Explanation:
import java.util.Scanner;
class parcel
{
public static void main(String[]args)
{
int charges;
Scanner in=new Scanner(System.in);
System.out.println("Enter the weight of parcel in grams");
int weight = in.nextInt();
if( weight < =100)
{
charges = 40;
System.out.println("Parcel charges : "+ charges);
if ( weight ! = 100)
{
charges = 60; // additional weight we are adding 20 to the Rs. 40
System.out.println("Parcel charges :"+charges);
Similar questions
Math,
4 months ago
English,
4 months ago
Math,
4 months ago
Environmental Sciences,
11 months ago
Environmental Sciences,
11 months ago