Question: Please help me write this program. (a) Population bar chart: Write a program that asks the user to enter the population. of 4 cities and
Please help me write this program.
(a) Population bar chart: Write a program that asks the user to enter the population. of 4 cities and produce the bar graph Here is an example of programs 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: 15000 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 programs output if user input is less than zero. (Error message is in Red. (Assume that user enter 3 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 : 8000 Population cant be negative. Please re-enter Enter the population of city (bolded to identify error message for negative numbers) 1 : 2000 Enter the population of city 2 : 3000 Enter the population of city 3 : 4000 Enter the population of city 4 : 8000 City 1 : ** City 2 : *** City 3 : ****
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
