Question: please help solve part b (b) [5 Points Bonus] Modify your program above that asks the user to enter number of cities he/she would like

please help solve part b
please help solve part b (b) [5 Points Bonus] Modify your program
above that asks the user to enter number of cities he/she would

(b) [5 Points Bonus] Modify your program above that asks the user to enter number of cities he/she would like to enter population. Then ask the user to enter the population for each city and produce the bar graph Here is an example of program's output. User input is shown bold. Please enter number of cities: 4 Enter the population of city 1:10000 Enter the population of city 2: 16000 Enter the population of city 3: 9000 Enter the population of city 4: 18000 POPULATION (each * = 1000 people) City 1: ********** City 2: ************** City 3: ******** City 4: *********** Input validation: Do not accept population less than 0. Here is an example of program's output if user input is less than zero. (Error message is in Red. (Assume that user enter 4 for number of cities in this case) Enter the population of city 1:-20 Enter the population of city 2: 3000 Enter the population of city 3: 4000 Enter the population of city 4: 7000 Population can't be negative. Please re-enter Enter the population of city 1: 2000 Enter the population of city 2: 3000 Enter the population of city 3: 4000 Enter the population of city 4: 7000 POPULATION (each - 1000 people) City 1." City 2: *** City 3: **** City 4: **** #include using namespace std; #define NUM CITIES 4 sint main() int population[NUM_CITIES), t; bool negEntered) while (1) negEntered = false; for (int i = 0; i > population[i]; if (population[i] 0) { cout cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!