Oswald M. answered 08/24/23
COP 1334 - Starting Out with C++ Early Objects, 10th Ed. PEARSON.
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
using namespace std;
int main() {
const double RANGE = 1000;
int year1900, year1920, year1940, year1960, year1980, year2000;
cin >> year1900 >> year1920 >> year1940 >> year1960 >> year1980 >> year2000;
string asterics1900, asterics1920, asterics1940, asterics1960, asterics1980, asterics2000;
double bar1900 = ceil(year1900/RANGE);
double bar1920 = ceil(year1920/RANGE);
double bar1940 = ceil(year1940/RANGE);
double bar1960 = ceil(year1960/RANGE);
double bar1980 = ceil(year1980/RANGE);
double bar2000 = ceil(year2000/RANGE);
int population;
cout << "1900 ";
for(int i = 0; i < bar1900; i++){
cout << "*";
}
cout << endl;
cout << "1920 ";
for(int i = 0; i < bar1920; i++){
cout << "*";
}
cout << endl;
cout << "1940 ";
for(int i = 0; i < bar1940; i++){
cout << "*";
}
cout << endl;
cout << "1960 ";
for(int i = 0; i < bar1960; i++){
cout << "*";
}
cout << endl;
cout << "1980 ";
for(int i = 0; i < bar1980; i++){
cout << "*";
}
cout << endl;
cout << "2000 ";
for(int i = 0; i < bar2000; i++){
cout << "*";
}
cout << endl;
return 0;
}// main braces ends