I have to write a program that does the following:
Write a program that produces a bar chart showing the population growth of the triokites until their population hits 50,000.
The user should enter the the number of triokites in the valley (rounded to the nearest 1,000) for each of the first 5 four-hour blocks. The program should average these values and use that average to predict when the number of triokites will reach 50,000.
For each four-hour block, the program should display the hour and a bar consisting of one asterisk for each 1,000 trinkets.
accepts and validates user input
computes average
displays chart
Here is an example a chart that shows the population growth (using example data):
TRIOKITE POPULATION GROWTH
Each * represents 1,000 triokites
Recorded Growth
0 *
4 ***
8 *****
12 *******
16 **********
20 *************
Predicted Growth
24 **************
28 ****************
Continue your table until growth reaches 50,000
108 **************************************************
Can someone give me any advice as to how to approach this? (what kind of loop to use etc..)
This is what I have so far.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
#include <iostream>
using namespace std;
int main()
{
double numOfTriokite = 0.0;
cout << "Please enter the number of Triokite in the valley: ";
cin >> numOfTriokite;
return 0;
}
|