Page 276 - CA_Blue( J )_Class10
P. 276

5      long acno;

                 6      char type_acc;
                 7      int bal;
                 8

                 9      void input()

                10      {
                11          Scanner sc= new Scanner(System.in);

                12          System.out.print("Enter Name of Customer : ");
                13          cus_name=sc.nextLine();

                14          System.out.print("Enter account number of Customer : ");
                15          acno=sc.nextInt();
                16          System.out.print("Enter type of account of Customer : ");

                17          type_acc=sc.next().charAt(0);

                18          do
                19          {

                20              System.out.print("Enter the balance amount in the account(minimum"
                    +"amount 1000/-) ");
                21              bal=sc.nextInt();
                22          }while(bal<1000);

                23      }
                24

                25      void deposit(int d)
                26      {

                27          bal+=d;
                28      }

                29
                30      void withdraw(int w)
                31      {

                32          int temp=bal-w;

                33          if(temp<1000)
                34              System.out.println("Minimum balance should be 1000 rupees");
                35          else

                36              bal=temp;
                37      }

                38



                274274  Touchpad Computer Applications-X
   271   272   273   274   275   276   277   278   279   280   281