Page 277 - CA_Blue( J )_Class10
P. 277

39       void print()
                  40       {

                  41           System.out.println("Customer Name:"+cus_name);
                  42           System.out.println("Account No.:"+acno);

                  43           System.out.println("Balance:"+bal);
                  44           System.out.println("Type of Account:"+type_acc);

                  45       }
                  46

                  47       public static void main(String args[])
                  48       {

                  49           Scanner sc=new Scanner(System.in);
                  50           Banking_system ob=new Banking_system();
                  51

                  52           ob.input();

                  53           char c;int amt;
                  54           System.out.println("Enter (D)eposit/(W)ithdraw:");
                  55           c=sc.next().charAt(0);

                  56           if(c=='D')
                  57           {

                  58               System.out.println("Enter the amount to deposit:");
                  59               amt=sc.nextInt();

                  60               ob.deposit(amt);
                  61           }

                  62           else if(c=='W')
                  63           {

                  64               System.out.println("Enter the amount to withdraw:");
                  65               amt=sc.nextInt();

                  66               ob.withdraw(amt);
                  67           }

                  68           else
                  69               System.out.println("Invalid input");

                  70           ob.print();
                  71       }

                  72   }




                                                                                                                       275
                                                                                      Class as the Basis of all Computation  275
   272   273   274   275   276   277   278   279   280   281   282