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 CompoundInterest_FirstName_LastName or
Lab3_FirstName_LastName. 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 *(1+ rate)years
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:
1. The following example assumes the user enters an initial value of 200000, a number of
elapsed years of 25, and an interest rate of 6. Keep in mind the rate will be converted to
0.06 for the calculation.
Please enter the initial value of the home: 200000
Please enter the number of elapsed years: 25
Please enter the interest rate: 6
The final value of the home is $858374.1439486976
2. The following example assumes the user enters an initial value of 500000, a number of
elapsed years of 40, and an interest rate of 7.5. Keep in mind the rate will be converted
to 0.075 for the calculation.
Please enter the initial value of the home: 500000
Please enter the number of elapsed years: 40
Please enter the interest rate: 7.5
The final value of the home is $9022119.484901305
Criteria: Make sure you have the following in your program:
Comments describing this program (5 points)
Variable declarations for the inputs and outputs (18 points)
Requesting the users inputs (24 points)
Converting the percentage to a decimal (6 points)
Calculating the final value of the home (35 points)
Displaying the final value (12 points)

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 Programming Questions!