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

(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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
