------------------------------------------------------------
CSIS 2610 Lab 4 More complex looping
------------------------------------------------------------
Purpose
------------------------------------------------------------
This program will give you experience and practice with:
More complex looping
------------------------------------------------------------
Input
------------------------------------------------------------
The input to your program is a series of records of the form:
An int customer ID, CustomerID
A float initial deposit, Principle
A float interest rate, InterestRate
An int number of years, Years
The dummy value to indicate end of file will have
a negative CustomerID
------------------------------------------------------------
Processing
------------------------------------------------------------
Your program must accomplish the following processing:
Prompt the user for a customer ID
Read the CustomerID
Loop for valid customer IDs:
Prompt the user for the remaining three inputs
Display ten heading lines on a new screen, including
four FORMATTED lines
Set OnePlusInterestRate = 1 + InterestRate
Inner Loop (runs 1 through Years) Use YearNumber for your loop counter
Compute the Future Value at the end of year YearNumber:
Math version of Future Value Formula: F = P * ( 1 + i ) ^ n
where:
F = the future value after YearNumber years
P = Principle
i = InterestRate Note: use OnePlusInterestRate for (1 + i)
n = YearNumber
(Of course, this must be translated into a C++ version!)
Display the year number and future value in a formatted line
Display a blank line and the hit ENTER to continue line
Pause the screen
Prompt the user for another CustomerID
Read the next CustomerID
------------------------------------------------------------
Output
------------------------------------------------------------
For the sample input 11111 1000 .06 4
Your output should look like this, with
the first scale line displaying on line one of a new screen:
1 2 3 4 5 6 7
1234567890123456789012345678901234567890123456789012345678901234567890
Customer 11111
Principle 1000.00
Rate 0.06
Years 4
Year Value at End of Year
1 1060.00
2 1123.60
3 1191.02
4 1262.48
Please hit ENTER to process the next customer
All formatted numbers should be right-justified.
The official test input will be provided on lab day.
------------------------------------------------------------