Page 607 - Computer science 868 Class 12
P. 607

47      super(a1,b1);
                   48      rate=r1;

                   49      time=t1;
                   50      }
                   51      double Interest()//To find Compound Interest

                   52      {

                   53      double CI=0.0;
                   54              CI=(principle*(Math.pow((1+(rate/100)),time)))-principle;
                   55      return CI;

                   56      }
                   57      void display() //To display Info

                   58      {
                   59      super.display();

                   60      System.out.println("The Rate of Interest is " + rate + " and Time is " + time);
                   61          }

                   62      }
                   63

                   64      Codes for main class Account_Main:-
                   65

                   66      import java.io.*;
                   67      class Account_Main

                   68      {
                   69      public static void main(String args[])throws IOException

                   70      {
                   71      InputStreamReader ISR=new InputStreamReader(System.in);

                   72      BufferedReaderbr=new BufferedReader(ISR);
                   73      inta,ch=0;

                   74      doubler,t,CI,SI,p;//Declaring Variables to enter Data
                   75      System.out.print("Enter Account Number: ");
                   76              a=Integer.parseInt(br.readLine());

                   77      System.out.print("Enter Principle Amount: ");

                   78              p=Integer.parseInt(br.readLine());
                   79      do
                   80      {





                                                                                                                       605
                                                                                                   Internal Assessment  605
   602   603   604   605   606   607   608   609   610   611   612