Page 462 - Computer science 868 Class 12
P. 462

9         }
                10         void calamt()

                11         { if(place=='N')
                12             amt=65000*heads;

                13           else if(place=='P')
                14             amt=52000*heads;

                15           else if(place=='L')
                16             amt=45000*heads;

                17           else if(place=='I')
                18             amt=55000*heads;

                19           }
                20           void print()
                21           { if(place=='N')

                22              System.out.println("Destination New York Heads "+heads+" Total amount Rs
                                "+amt);
                23             if(place=='P')

                24              System.out.println("Destination Paris Heads "+heads+" Total amount Rs
                                "+amt);
                25             if(place=='L')

                26              System.out.println("Destination London Heads "+heads+"  Total amount Rs
                                "+amt);
                27             if(place=='I')

                28              System.out.println("Destination Italy Heads "+heads+" Total amount Rs
                                "+amt);
                29           }}
                30
                31       class Discount extends Airlines

                32       { double dis,famt;

                33         Discount(char p,int h)
                34         { super(p,h); //calling super class constructor
                35           dis=famt=0.0;

                36         }
                37         void calnet()

                38         { calamt(); // supe class method
                39           if(amt>=500000)

                40             dis=amt*0.15;
                41           else if(amt>=250000)




                460460  Touchpad Computer Science-XII
   457   458   459   460   461   462   463   464   465   466   467