Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Request: Write a program that computes an investment report. Analysis: The inputs to this program are the following: 2 The program uses a simplified
Request: Write a program that computes an investment report. Analysis: The inputs to this program are the following: 2 The program uses a simplified form of compound interest, in which the interest in computed once each year an added to the total amount invested. The output of the program is a report in tabular form that shows, for each year in the term of the investment, the year number, the initial balance in the account for that year, the interest earned for that year, and the ending balance for that year. The columns of the table are suitably labeled with a header in the first row. Following the output of the table, the program prints the total amount of the investment balance and the total amount of interest earned for the period. The proposed user interface is shown below: 4 5 Enter the investment amount: $ 10000.00 Enter the number of years: 5 Enter the rate as a %: 5 Year An initial amount to be invested (a floating-point number) A period of years (an integer) An interest rate (a percentage expressed as an integer) Starting 10000.00 10500.00 11025.00 11576.25 12155.06 Balance Interest 500.00 525.00 551.00 578.81 607.75 Ending Balance: $ 12762.82 Total Interest Earned: $ 2762.82 Ending Balance. 10500.00 11025.00 11576.25 12155.06 12762.82 The four principal parts of the program perform the following tasks: 1. Receive the user's inputs and initialize data. 2. Display the table's header. 3. Compute the results for each year, and display team as a row in the table. 4. Display the totals. The third part of the program, which computes and displays the results, is a loop. Note that the starting balance refers to the original input balance and also to the balance that begins each year of the term. Ignoring the details of the output at this point allows us to focus on getting the computations correct.
Step by Step Solution
★★★★★
3.48 Rating (151 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started