Answer:
Written in C++
#include<iostream>
#include<math.h>
using namespace std;
int main(){
double Amount, Rate;
cout<<"Initial Amount: ";
cin>>Amount;
cout<<"Rate: ";
cin>>Rate;
for(int i =1;i<=3;i++){
Amount = Amount *(pow((1+Rate/100),1));
cout<<"Balance: "<<Amount<<endl;
}
return 0;
}
Step-by-step explanation:
The program was written in C++ (The line by line explanation is as follows)
This line declares Amount and Rate as double
double Amount, Rate;
This line prompts user for Amount
cout<<"Initial Amount: ";
This line gets input for Amount
cin>>Amount;
This line prompts user for Rate
cout<<"Rate: ";
This line gets input for Rate
cin>>Rate;
The following iteration calculates and prints the new balance at the end of each month using compound interest formula
for(int i =1;i<=3;i++){
Amount = Amount *(pow((1+Rate/100),1));
cout<<"Balance: "<<Amount<<endl;
}