Just have a question. I want to recreate this table with any percentage and number however, I looped the years but I also need to loop the number of students each year. How do I do this? For loop into a for loop?.I have calcuated the amount of students by subtracting each two years and found a pattern. How do I loop this? https://imgur.com/a/Mi9Eeqi
#include <iostream>
#include <cmath>
usingnamespace std;//have to use this for now.
int main(){
double U,O,F,W,G;
int count;
int year;
int i;
double offers;
double declines;
double withdrawal;
double graduate;
double overall_pop;
cout<<"Enter the current population: ";
cin>>U;
cout<<"Enter the % of offer letters: ";
cin>>O;
cout<<"Enter the % of offers declined (financial reasons): ";
cin>>F;
cout<<"Enter the % of students that withdraw: ";
cin>>W;
cout<<"Enter the % of students that graduate: ";
cin>>G;
cout<<"Year\t\tOffers\t\tDecline\t\tWithdraw\tGraduate\tCurrent Population"<<endl;
for(i=0;i<100;i=i+1){
cout<<"_";
}
cout<<endl;
for(count=0;count<10;count=count+1){
year=2009+count;
offers=(O/100)*U;
declines=(F/100)*offers;
withdrawal=(W/100)*U;
graduate=(G/100)*U;
overall_pop=(offers-declines-withdrawal-graduate)+U;
cout<<year<<"\t\t "<<offers<<"\t\t"<<declines<<"\t\t"<<withdrawal<<"\t\t"<<graduate<<"\t\t"<<overall_pop<<endl;
}
}