Question: Modify your Module 1 Lab Assignment. Create a new class InvestmentSavingsAccount.java class that extends the SavingsAccount class. Your investment savings class will have an InvestmentSavingsAccount
Modify your Module 1 Lab Assignment. Create a new class InvestmentSavingsAccount.java class that extends the SavingsAccount class.
Your investment savings class will have an InvestmentSavingsAccount constructor with one argument . If the deposit is more than $1000, the deposit will earn 2.0% in interest. You will need to create new methods to get the investment interest rate, set the new savings account balance and override the toString() method for the SavingsAccount class. Your new toString() method will return a formatted string with the original savings amount and the investment savings amount.
Use the CommissionEmployee example in the text to assist you in completing this assignment.
NEW CLASS - InvestmentSavingsAccount.java
// Module 2 Assignment - InvestmentSavingAccount
// InvestmentSavingAccount class definition
public class InvestmentSavingsAccount extends SavingsAccount{
// Declare global variable annual interest rate
// Declare global variable investment balance
// constructor, create a one arguement constructor for investment savings account.
// If investment balance is greater than 1000, assign value of investment balance to this investment balance
//else print "investment balance must be at least $1000"
//modify the interest rate
//if the new interest rate is equal to 2, set the annual interest rate equal to the new interest rate, else print error message "rate must be 2.0"
// calculate the investment balance and monthly interest based on investment balance and annual Interest Rate
// the investment balance is equal to the current investment balance plus the new investment balance times annual Interest Rate divided by 12.0
@Override //indicates that this methods overrides a superclass method
// get string representation of investment balance
//return the investment balance value and interest rate as a formatted string
} // end class InvestmentSavingsAccount
MODIFY CLASS - SavingsAccountTest.java
Modify the the SavingsAccountTest class. Create an InvestmentSavingsAccount object and execute the same methods executed for the SavingsAccount object in Module 1 Assignment.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
