In: Computer Science
need this in C++
Start
Declarations
number currentTuition
number futureTuition
number interestRate
number numYears
number year
output "Please enter current tuition: "
input currentTuition
output "Please enter interest rate (e.g. 9.0 for 9 percent): "
input interestRate
output "Please number of years for tuition: "
input numYears
output “Tuition at year 1 is “, currentTuition
futureTuition = currentTuition
for year = 2 to numYears
futureTuition = futureTuition * (1 + interestRate/100)
output “Tuition at year “, year ,”is “, futureTuition
endfor
Stop
#include <iostream>
using namespace std;
int main(){
int currentTuition;
int futureTuition;
int interestRate;
int numYears;
int year;
cout<<"Please enter current tuition: ";
cin>>currentTuition;
cout<<"Please enter interest rate (e.g. 9.0 for 9 percent): ";
cin>>interestRate;
cout<< "Please number of years for tuition: ";
cin>>numYears;
cout<<"Tuition at year 1 is :"<<currentTuition<<endl;
futureTuition = currentTuition;
for (int year = 2 ;year< numYears;year++){
futureTuition = futureTuition * (1 + interestRate/100.0);
cout<< "Tuition at year "<< year<<" is "<<futureTuition<<endl;
}
}
Note : Please comment below if you have concerns. I am here to help you
If you like my answer please rate and help me it is very Imp for me