Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String bankName = scanner.nextLine();
- int accountID = Integer.parseInt(scanner.nextLine());
- String user = scanner.nextLine();
- double money = Double.parseDouble(scanner.nextLine());
- BankAccount bankAccount1 = new BankAccount(bankName, accountID, user, money);
- BankAccount bankAccount2 = new BankAccount();
- bankAccount2.bankName=scanner.nextLine();
- bankAccount2.accountID=Integer.parseInt(scanner.nextLine());
- bankAccount2.user=scanner.nextLine();
- bankAccount2.money=Double.parseDouble(scanner.nextLine());
- System.out.println(bankAccount1);
- System.out.println(bankAccount2);
- bankAccount1.deposit(589.60);
- bankAccount2.deposit(589.60);
- System.out.println(bankAccount1);
- System.out.println(bankAccount2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment