Page 485 - CA_Blue( J )_Class10
P. 485

60    private static void OpenAccount() throws IOException
                    61    {

                    62      Calendar c=Calendar.getInstance();
                    63      int date=c.get(Calendar.DATE);

                    64      int month=c.get(Calendar.MONTH);
                    65      int year=c.get(Calendar.YEAR);

                    66      String n,p;
                    67      int m;

                    68      System.out.println("Your Account Number is : "+Ano);
                    69      System.out.print("Your Name : ");

                    70      n=x.readLine();
                    71      System.out.print("Opening Balance : ");
                    72      m=Integer.parseInt(x.readLine());

                    73      System.out.print("Your Password : ");

                    74      p=x.readLine();
                    75      Acc[Ano]=new Account(n,Ano,date,month,year,m,p);
                    76      Ano++;

                    77    }
                    78    private static void WithdrawMoney() throws IOException

                    79    {
                    80      String p;

                    81      int no,amt;
                    82      System.out.print("Your Account Number : ");

                    83      no=Integer.parseInt(x.readLine());
                    84      System.out.print("Password : ");

                    85      p=x.readLine();
                    86      if(no<Ano && p.equals(Acc[no].Password))

                    87      {
                    88        System.out.println("Welcome "+Acc[no].Name);

                    89        System.out.print("Withdrawl Amount : ");
                    90        amt=Integer.parseInt(x.readLine());

                    91        if(amt<=Acc[no].Total_Amt)
                    92          Acc[no].Total_Amt-=amt;

                    93        else




                                                                                                                       483
                                                                                                       Sample Project  483
   480   481   482   483   484   485   486   487   488   489   490