Page 282 - CA_Blue( J )_Class10
P. 282

17      }

                18
                19      void cal()

                20      {
                21          call=pre-prv;

                22          if(call<=100)
                23              amt=0.0;

                24          else if(call>100 && call<=200)
                25              amt=0*100+(call-100)*0.90;

                26          else if(call>200 && call<=400)
                27              amt=0*100+100*0.90+(call-200)*0.80;

                28          else
                29              amt=0*100+100*0.90+200*0.80+(call-400)*0.70;
                30          total=amt+180;

                31      }

                32
                33      void display()
                34      {

                35          System.out.println("Name"+"\t"+"Calls Made"+"\t"+"Amount without service"
                    +"tax"+"\t"+"Total Amount");
                36          System.out.println(name+"\t"+call+"\t"+amt+"\t"+total);

                37      }
                38

                39      public static void main(String args[])
                40      {
                41          Telephone ob=new Telephone ();

                42          ob.input();

                43          ob.cal();
                44          ob.display();
                45  }

                46  }
















                280280  Touchpad Computer Applications-X
   277   278   279   280   281   282   283   284   285   286   287