Question: Write a C++ program that asks the user to enter the population of 4 cities and produce the bar graph. USE A DO-WHILE LOOP Input

Write a C++ program that asks the user to enter the population of 4 cities and produce the bar graph. USE A DO-WHILE LOOP

Input validation: Do not accept population less than 0.

Here is an example of programs output if user input is less than zero.

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

RESULTS BELOW:

Population cant be negative. Please re-enter

// Program should allow user to re-enter after error message

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 : 8000

OUTPUT BELOW:

POPULATION (each * = 1000 people) City 1 : ** City 2 : *** City 3 : **** City 4: ********

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!