Computer Science, asked by aditidwi7, 6 months ago

write a program in java to enter the number of calls made by a customer.calculate and display the amount charged based on the following table:
number of calls - charge per call
first 100 calls. - Rs.2
next 100 calls. - Rs.1.5
above 200 calls - Rs.1​

Answers

Answered by aadhyar23
4

Answer:

import java.util.*;

public class calls

{

  public static void main()

   {

     Scanner in= new Scanner(System.in);

     System.out.println("Enter the no of calls made :");

     int call= in.nextInt();

     double amt;

     if( call<=100)

        amt= 2*call;

     else if(call<=200&&call>100)

        amt= 200+ 1.5*(call-100);

     else

        amt= 200+150+1.0*(call-200);

     System.out.println(" Amount for "+ call+"calls is " +amt);

}}

Explanation:

Similar questions