English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

"suppose P0 is the initial amount & INT is the interst rate per year. If P1, P2, and P3 is the balance at the end of the first, second and third year, respectively, then:
P1 = P0 + P0*INT = P0 * (1 + INT)

P2 = P1 + P1*INT = P1 * (1 + INT) = P0 * (1 + INT) * (1 + INT) = P0 * (1 + INT)^2

P3 = P2 + P2*INT = P2 * (1 + INT) = P0 * (1 + INT) * (1 + INT) * (1 + INT) = P0 * (1 + INT)^3"

basically, i need to write a program that reads an initial investment, at age 16, and uses a FOR loop to calculate the total after 44 years (till age 60) with 10% or (0.1) interest compounded annually. (and i am not supposed to use the POW function.)

the FOR loop should only be used to calculate up to age 60. But thn after the for loop, the program should calculate the totl amnt for 1 additional yr (till age 61). Then starting from age 61, calculate each yrs interest income. In other words " interest earned this yr is:$. if interest is withdrawn ech yr thereafter, my income is:$ per month

2006-09-24 17:16:59 · 2 answers · asked by inschool4life 2 in Computers & Internet Programming & Design

2 answers

So where is the code you have written so far?

2006-09-24 17:35:24 · answer #1 · answered by D 4 · 0 0

const unsigned int startYear=16;
const unsigned int endYear=60;
const float interest=0.1;
const float investment=1000;

float p=investment;
for(unsigned int y=startYear; y cout << "Income=" << p*interest << endl;

2006-09-25 00:42:14 · answer #2 · answered by muon 3 · 0 0

fedest.com, questions and answers