Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions

Question

=+What can I do to make this press worthy?

Answered: 1 week ago