Compound Interest Calculator
Morty decided to save early and start a compound interest saving account. compound
interest* calculation Java class to help Morty determine the total amount in his account given
an original deposit amount (P), an annual interest rate (R), and time in years (T), assuming
interest will be compounded quarterly†.
Requirements:
1. Create and execute your program using IntelliJ IDEA.
2. Name your Java class LastnameFirstnameA1 (replace LastnameFirstname with your name).
3. Pass P, R, T as command-line arguments.
java LastnameFirstnameA1 4000 6 5 //in terminal
Or in Run/Debug Configurations
4. The following usage should be displayed if arguments are missing or invalid arguments are
passed to the program.
Usage: java LastnameFirstnameA1 original_deposit_amount annual_interest_rate
time_in_years
5. Your output should be like the following test samples.
* Compound Interest: the interest you earn on your account’s original deposit (the principal) plus previous interest. † Compound quarterly: the interest you earned would be added to your original investment amount every three
months.
Page 2 of 3
Sample Test Cases:
Test Case 1 – java LastnameFirstnameA1 4000 6 5
Output –
There will be $5387.42 in the account if deposit $4000 with 6% interest rate
after 5 years.
Program Completed
Test Case 2 – java LastnameFirstnameA1 2500 5.25 8.5
Output –
There will be $3894.78 in the account if deposit $2500 with 5.25% interest
rate after 8.5 years.
Program Completed
Test Case 3 – java LastnameFirstnameA1 800 R
Output –
Usage: java LastnameFirstnameA1 original_deposit_amount annual_interest_rate
time_in_years
Program Completed
Notes:
1. The program should always print ‘Program Completed’ before exiting.
2. Check if your program works properly by giving different inputs.
3. Give comments to increase code readability.
4. Mention the sources used to complete the assignment.
5. Save the file as LastnameFirstnameA1.java
6. Submit .java file and a screenshot of terminal when you run the program.