Write two programs that tracks an investment for 1 person


Please help with this programming question involving, Composition and Aggregation, Inheritance, and Constructors in a Subclass.

Please make sure it compiles in java. The files must be called LIFIUnit4Ch13.java and LIFIUnit4Ch13investor.java Basic

Requirements: Write two programs that tracks an investment for 1 person based on the input of an interest rate.

The initial balance should be $2,000. The interest should be added to the balance and output in table format. LiFiUnit4Ch13.java

o Instantiate an investor1 object using a two parameter constructor passing the account number 1001 and the initial balance of $2,000 oGet input for interest rate (in the format .08 for 8%)

o Output header as per sample showing interest rate

o Print the table using a for loop displaying the current month and calling: ? getBalance() to display the current balance (See sample) 45% ? addInterest() to add the monthly interest for each iteration Sample output is provided below.

Be sure to mimic it exactly except for values will change based on the interest rate entered. LiFiUnit4Ch13Investor.java

o Declare a class variable called interestRate (This will hold the annual interest rate)

o Declare a constant called ACCOUNT_NUMBER o Declare an instance variable called balance

o Provide a class method that will be used to set the annual interest rate

o Provide a two parameter constructor to initialize the constant account number and balance

o Provide an addInterest() method to update the balance based on the interestRate entered in the driver ? Add the interest using (balance * interestRate / 12)

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write two programs that tracks an investment for 1 person
Reference No:- TGS02889541

Expected delivery within 24 Hours