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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started