Answer to Question #9709 in C++ for jacob

Question #9709
write C++ program that predict the population size of organisms.must ask user to enter daily avarege increase in %, number they will multiply.results must be displayed in a table form.
1
Expert's answer
2012-05-18T07:17:58-0400
#include <iostream>

using namespace std;





int main(){

int days;

double size, inc;

cout<<"Inputinitial population size: ";

cin>>size;

cout<<"Days: ";

cin>>days;

cout<<"Daily avarege increase, %: ";

cin>>inc;

cout<<" Day | Size
";

cout<<"________________|________________
";

inc /= 100;

for(int d = 1; d < days; d++){

size += size*inc;

cout<<" "<<d<<" | "<<(int)size<<"
";

}

system("pause");

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS