Computer Science, asked by Devkii65131, 8 months ago

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 ramabisa
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