Question: Create a new Java project titled either CompoundInterest _ FirstName _ LastName or Lab 3 _ FirstName _ LastName. You must include comments describing key
Create a new Java project titled either CompoundInterestFirstNameLastName or
LabFirstNameLastName. You must include comments describing key parts of this program.
This program will require three inputs from the user for the initial value of the home, the number
of elapsed years, and the interest rate. This program will also have one output for the final value
of the home. Declare variables that meet the requirements for this program.
Prompt the user to input the initial value of the home, the number of elapsed years, and the
interest rate.
The number of elapsed years is expected to be an integer value, which will require a different
method to get the user input. As a hint for the method, if the double data type uses nextDouble,
what would the int data type use?
Since the user will input the interest rate as a percentage, you will need to convert this to a
decimal amount.
Calculate the final value of the home using the following formula for compound interest:
finalValue initial rateyears
Be careful about the order of operations. Addition should be performed first, then the power, and
then multiplication.
Display a message that includes the final value to the user.
Examples:
The following example assumes the user enters an initial value of a number of
elapsed years of and an interest rate of Keep in mind the rate will be converted to
for the calculation.
Please enter the initial value of the home:
Please enter the number of elapsed years:
Please enter the interest rate:
The final value of the home is $
The following example assumes the user enters an initial value of a number of
elapsed years of and an interest rate of Keep in mind the rate will be converted
to for the calculation.
Please enter the initial value of the home:
Please enter the number of elapsed years:
Please enter the interest rate:
The final value of the home is $
Criteria: Make sure you have the following in your program:
Comments describing this program points
Variable declarations for the inputs and outputs points
Requesting the users inputs points
Converting the percentage to a decimal points
Calculating the final value of the home points
Displaying the final value points
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
