Question: Download the Bank.java driver class file from the class GitHub repository Add a comment at the top of each code file with your name, course
Download the Bank.java driver class file from the class GitHub repository
Add a comment at the top of each code file with your name, course name & section, and todays date the format for this is up to you, but be clear & consistent
Create a class called BankAccount in a separate file from the driver that represents a bank account that includes the following:
Fields:
The owners name String
The account number int
The account balance double
A static private int accountCount
Constructors:
NOTE: both constructors should assign an account number by adding to the accountCount fields value, then incrementing accountCount
A constructor with the owners name as a parameter. Set the balance to in the constructor.
A constructor with the owners name & initial balance as parameters.
Methods:
getBalanceis a getter method that returns the balance
depositamountis a setter method that adds amount to the balance
withdrawamountis a setter method that subtracts amount from the balance
Other gettersetter methods as you see fit think about what things can or cannot change in a bank account
getAccountCount returns the number of accounts that have been created
toString returns the owners name, account number, and balance as a String
Create a driver class that does the following:
Create bank accounts with the following balances: &
Display the bank accounts using your toString method
Deposit in account
Deposit in account
Withdraw from account
Withdraw from account
Deposit in account
Display the bank accounts again after the withdrawals & deposits
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
