Answered step by step
Verified Expert Solution
Link Copied!

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: Analysis: The inputs to this program are the following An initial amount to be invested (a floating-point number) A

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach to Design Implementation and Management

Authors: Thomas Connolly, Carolyn Begg

6th Edition Global

132943263, 978-0132943260

More Books

Students also viewed these Programming questions

Question

What is a FLWOR expression?

Answered: 1 week ago

Question

Describe what a super class and a subclass represent.

Answered: 1 week ago