ruhul0

Bank

Feb 25th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.38 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Bank {
  4.  
  5.     public static void main(String[] args) {
  6.         // TODO Auto-generated method stub
  7.         int choice1;
  8.         String choice2;
  9.         while(true)
  10.         {
  11.             System.out.println("What type of account you want to create?");
  12.             System.out.println("1: Saving Account");
  13.             System.out.println("2: Current Account");
  14.             System.out.println("3: Student Account");
  15.             Scanner sc= new Scanner(System.in);
  16.             choice1 = sc.nextInt();
  17.             if(choice1==1)
  18.             {
  19.                 String name;
  20.                 int ab,mb,tn;
  21.                 System.out.println("Name:");
  22.                 name=sc.next();
  23.                 System.out.println("Account Balance:");
  24.                 ab=sc.nextInt();
  25.                 System.out.println("Minimum Balance:")
  26.                 mb=sc.nextInt();
  27.                 System.out.println("Trade Number:");
  28.                 tn=sc.nextInt();
  29.                 SavingAccount sa = new SavingAccount(name,ab,mb,tn);
  30.                
  31.                 System.out.println("Enter 1 or d to deposit");
  32.                 System.out.println("Enter 2 to withdraw");
  33.                 System.out.println("Enter 3 to show balance");
  34.                 System.out.println("Enter 0 to exit");
  35.                 choice2=sc.next();
  36.                 if(choice2=="1"||choice2=="d")
  37.                 {
  38.                     int balance;
  39.                     System.out.println("Enter the amount you want to deposit:");
  40.                     balance=sc.nextInt();
  41.                     sa.deposit(balance);
  42.                 }
  43.                 if(choice2=="2")
  44.                 {
  45.                     int draw;
  46.                     System.out.println("Enter the amout you want to withdraw");
  47.                    
  48.                 }
  49.             }
  50.        
  51.         }
  52.        
  53.        
  54.  
  55.     }
  56.  
  57. }
Add Comment
Please, Sign In to add comment