Page 608 - Computer science 868 Class 12
P. 608

81       System.out.println("Main Menu");
                82       System.out.println("Press 1 to check Simple Interest");

                83       System.out.println("Press 2 to check Compound Interest");
                84       System.out.println("Press 3 to Exit");
                85       System.out.print("Please Enter Your Choice: ");

                86       ch=Integer.parseInt(br.readLine());

                87       switch(ch)
                88       {
                89       case 1: System.out.print("Rate: ");

                90               r=Integer.parseInt(br.readLine());
                91       System.out.print("Time: ");

                92               t=Integer.parseInt(br.readLine());
                93       Simple_Interestob=new Simple_Interest(a,p,r,t);

                94               SI=ob.Interest();
                95       ob.display();

                96       System.out.println("Simple Interest: " + SI);
                97       break;

                98       case 2: System.out.print("Rate: ");
                99               r=Integer.parseInt(br.readLine());

                100      System.out.print("Time: ");
                101               t=Integer.parseInt(br.readLine());

                102      Compound_Interest ob1=new Compound_Interest(a,p,r,t);
                103              CI=ob1.Interest();

                104      ob1.display();
                105      System.out.println("Compound Interest: " + CI);

                106      break;
                107      case 3: System.out.println("THANK YOU!");

                108      break;
                109      default:System.out.println("Invalid Choice");
                110                  }

                111              }

                112      while(ch!=3);
                113          } //Close of Main
                114      } //Close of Class





                606606  Touchpad Computer Science-XII
   603   604   605   606   607   608   609   610   611   612   613