Question: Program 3: Design (pseudocode) and implement thon code) a class (name it BankAccount) that defines the following data fields and methods: 1. Private int data
Program 3: Design (pseudocode) and implement thon code) a class (name it BankAccount) that defines the following data fields and methods: 1. Private int data field named id to store the account 2. Private double data field named balance to store the account balance (default value is o.0 ID (default value is 0) 3. Private double data field name d annualInterestRate to store the interest rate (default value is 0.0%). Assume all accounts have same inte te. Annual interest rate is ra percentage such as 3.2%, thus you need to divide by 100 to get double value 0.032) 4. Private Date data field named datecreated to store the date when the account was crea 5. Non-argument constructor method that creates a default account (with default values). 6. Constructor method that creates an account with specified ID and initial balance. 7. Get and Set methods for variables id, balance, and annualInterestRate. 8. Get method for variable dateCreated 9. Method named getMonthlyInterestRate() that returns the monthly interest rate (i.e annual interes tRate / 12, formatted as percentage (%)). 10. Method named getMonthlyInterest that returns the earned monthly interest amou (i.e., balance monthlyInterestRate, formatted as currency ($)). 11. Method named withdraw) that withdraws a specific amount from the account. 12. Method named deposit) that deposits a specific amount to the account. 13. Method tostring ) to printout a meaningful description of an account object using all o instance variables in the following format Account ID Account Balance: Interest Rate: Date Opened: 123456 $7,000.00 2.50% Sun Nov 2 14:18:16 EDT 2017 Now design (pseudocode) and implement (source code) a test program (name it TestBankAccount) to create an account object named myObject as follows Account ID is 123456; The Initial balance is $10,000 The annual interest rate is 2.5% Withdraw $3,500 - Deposit $500 Print out the account balance Print out the earned monthly interest Print out the date the account was created
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
