Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package package1;
- import java.util.*;
- import java.io.*;
- import java.util.ArrayList;
- import java.util.Scanner;
- import java.io.*;
- public class Main extends Transactions{
- public static void main(String[] args) throws IOException {
- // FileInputStream fis = new FileInputStream("Yasmeen.txt");
- int choise1;
- int choise2;
- Scanner in = new Scanner(System.in);
- Account A = new Account ();
- Transactions T = new Transactions();
- ArrayList<CheckAccount> List1= new ArrayList<CheckAccount>();
- CheckAccount check1 = new CheckAccount(1,"Yasmeen");
- CheckAccount check2 = new CheckAccount(2,"Mariam");
- CheckAccount check3 = new CheckAccount(3,"Zeinab");
- CheckAccount check4 = new CheckAccount(4,"Yomna");
- CheckAccount check5 = new CheckAccount(5,"Yasmin");
- List1.add(check1);
- List1.add(check2);
- List1.add(check3);
- List1.add(check4);
- List1.add(check5);
- int customerId;
- System.out.println("Enter Customer ID");
- customerId = in.nextInt();
- boolean flag = true;
- while(flag) {
- System.out.println("Do you want to :");
- System.out.println("1) Do a Transaction ");
- System.out.println("2) Check your Balance ");
- System.out.println("3) Quit ");
- choise2 = in.nextInt();
- if(choise2 == 1)
- {
- if (customerId == check1.id || customerId == check2.id || customerId == check3.id || customerId == check4.id || customerId == check5.id )
- {
- //if (customerId == 1 )
- A.setName();
- A.setAccount_num();
- A.setBalance();
- System.out.println("If you want to withdraw enter >> 1 ");
- System.out.println("If you want to deposite enter >> 2 ");
- choise1 = in.nextInt();
- T.setAmount();
- if (choise1 ==1 ) {
- A.Withdrawal(amount);
- }
- else if (choise1 ==2 ) {
- A.Deposit(amount);
- }
- A.DisplayAccountInformation();
- }
- else {
- System.out.println("Invalid ID");
- }
- }
- if(choise2 == 2) {
- // FileWriter myWriter = new FileWriter("outcome.txt");
- System.out.println("Your Balance is : "+A.getBalance());
- System.out.println("Your Balance After Applying Annual Interest is : "+A.AnuualInterestRate());
- }
- if (choise2 == 3) {
- System.out.println("Thanks for Using our Bank ");
- flag = false;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment