Programming Homework Help
Dallas College Eastfield Campus Create a Program Code Java Coding Task
Problem Description:
Write a program in Java that reads in: (i) investment amount, (ii) annual interest rate, and (iii) number of years from the keyboard and calculates the future investment value using the following formulae:
h = × 12
h = 1200
= × (1 + h )!”#$%&'()*!+,-
Sample Run:
Enter investment amount: 1000
Enter annual interest rate in percentage points (e.g., 2.25 for 2.25%): 2.25 Enter the number of years: 2
The value of $1000.0 after 2 years is $1045.9837866210664
Hints:
- ImporttheScannerclassfromthejava.utilpackagetoreadthethreeinputvariables.
- Declare variables as “double” or “int” appropriately.
- UsetheMath.pow(a,b)functiontocompute !.
- Use the sample run in the instructions to test your program to make sure it is correctbefore you submit.
Deliverables:
Your .java file including:
- Asamplerunatthetopwithinvestmentamountof$2021.50,annualinterestrateof 3.5%, and 6 years. The four lines of the output (similar to those shown in the sample run above) should be inserted as a comment on the top of the Java code (before the import and class statements). (2 points)
- Your code with other appropriate comments. (Code: 6 points, Comments: 2 points)