Write a program that calculates how much money you’ll end up with if you invest an amount of money at a fixed interest rate, compounded yearly. Have the user furnish the initial amount, the number of years, and the yearly interest rate in percent. Some interaction with the program might look like this: Enter initial amount: 3000 Enter number of years: 10 Enter interest rate (percent per year): 5.5 At the end of 10 years, you will have 5124.43 dollars. At the end of the first year you have 3000 + (3000 * 0.055), which is 3165. At the end of the second year you have 3165 + (3165 * 0.055), which is 3339.08. Do this as many times as there are years. A for loop makes the calculation easy.
1
Expert's answer
2012-04-24T07:17:42-0400
int main(){ int& i,y,x; char ch; float r,ans,n; cout<<"enter the initial amount:"; cin>>i; cout<<"enter the no of years:"; cin>>y; cout<<"enter the rate of interest (percent per year):"; cin>>r; ans=i; for(x=1;x<=y;x++){ & ans=ans+(ans*r/100); & cout<<"at the end of the year the balace will be:"<<ans << endl; } cout<<endl; return 0; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment