Create a program in C++ language, create a flowchart, provide a screenshot of the program and output, and involve looping for your program:
Nested loops: Challenge.
Write a program that calculates and displays the yearly amount available if $1000 is invested in a bank account for 10 years. Your program should display the amounts available for interest rates from 6% to 12% inclusively, in 1% increments. Use a nested loop, with the outer loop controlling the interest rate and the inner loop controlling the years. Use the relationship that the money available at the end of each year equals the amount of money in the account at the start of the year plus the interest rate times the amount available at the start of the year.
#include<iostream>
using namespace std;
int main()
{
double amount = 1000;
for(int i=6;i<=12;i++)
{
cout<<"Interest Rate:
"<<i<<"% \n";
double temp = amount;
for(int j=1;j<=10;j++)
{
temp =
(temp+(temp*(i/(float)100)));
cout<<"Year "<<j<<":
"<<temp<<endl;
}
cout<<"\n";
}
}
//Output
Get Answers For Free
Most questions answered within 1 hours.