Question: please use cpp code In the main() function, prompt for the values of , , , and , and display the amount after each compounding
In themain()function, prompt for the values of , , , and , and display the amount after each compounding period as follows:
Enter the principal, APR, # of compounding periods per year, and number of years: 1000.0 0.10 2 4
$1050 in 0.5 years
$1102.5 in 1 years
$1157.63 in 1.5 years
$1215.51 in 2 years
$1276.28 in 2.5 years
$1340.1 in 3 years
$1407.1 in 3.5 years
$1477.46 in 4 years
Some code suggestions:
- A counter-based loop is needed that repeats times.
- A variable calledgrowthshould be declared that starts off at 1.0 and is multiplied by each time through the loop. The value of is readily calculated from andgrowth.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
