Question: Solve the project #3. Specifying the files Project # 2 Design a class named BankAccount that contains: 1. A private int data field named accountld

Solve the project #3. Specifying the files  Solve the project #3. Specifying the files Project # 2 Design
a class named BankAccount that contains: 1. A private int data field
named accountld for the account. 2. A private double data field named
accountBalance for the account (default 0). 3. A private double data field

Project # 2 Design a class named BankAccount that contains: 1. A private int data field named accountld for the account. 2. A private double data field named accountBalance for the account (default 0). 3. A private double data field named annuallnterestRate that stores the current interest rate (default 0). Assume all accounts have the same interest rate. 4. A private Date data field named dateCreated that stores the date when the account was created. 5. A no-arg constructor that creates a default account and initializes the accountld with a 4 digit random nteger 6. A one-argument constructor that creates an account with a specific initial balance (constructor argument) and initializes the accountld with a 4 digit random integer 7. The accessor and mutator methods for accountBalance and annuallnterestRate. 8. The accessor methods for dateCreated and accountld. 9. A method named getMonthlyInterestRate0 that returns the monthly interest rate. Where monthly interest rate is the annual interest rate divided by 12 10. A method named withdraw(double) that withdraws a specified amount from the account 11. A method named deposit(double) that deposits a specified amount to the account. Write a test program (class TestBankAccount) that creates a BankAccount object with a balance of $20,000, and an annual interest rate of 4.5%. Use the withdraw method to withdraw S2,500, use the deposit method to deposit $3,000 and then print the account id, Balance, the monthly interest, and the date when this account was created (use console output, see below). Answer Below: Project # 2 Design a class named BankAccount that contains: 1. A private int data field named accountld for the account. 2. A private double data field named accountBalance for the account (default 0). 3. A private double data field named annuallnterestRate that stores the current interest rate (default 0). Assume all accounts have the same interest rate. 4. A private Date data field named dateCreated that stores the date when the account was created. 5. A no-arg constructor that creates a default account and initializes the accountld with a 4 digit random nteger 6. A one-argument constructor that creates an account with a specific initial balance (constructor argument) and initializes the accountld with a 4 digit random integer 7. The accessor and mutator methods for accountBalance and annuallnterestRate. 8. The accessor methods for dateCreated and accountld. 9. A method named getMonthlyInterestRate0 that returns the monthly interest rate. Where monthly interest rate is the annual interest rate divided by 12 10. A method named withdraw(double) that withdraws a specified amount from the account 11. A method named deposit(double) that deposits a specified amount to the account. Write a test program (class TestBankAccount) that creates a BankAccount object with a balance of $20,000, and an annual interest rate of 4.5%. Use the withdraw method to withdraw S2,500, use the deposit method to deposit $3,000 and then print the account id, Balance, the monthly interest, and the date when this account was created (use console output, see below). Answer Below

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!