Bar Graph, v 1.0 Purpose. The purpose of this lab is to produce a bar graph showing the population growth of a city called Prairieville, California. The bar graph should show the population growth of the city in 20 year increments for the last 100 years. The bar graph should be printed using a loop. The loop can be either a while loop or a for loop. Write a program called cityPopulation Graph.cpp to produce the bar graph. Requirements. 1. Use these population values with their corresponding years: 1922, 2000 people 1942, 5000 people 1962, 6000 people 1982, 9000 people 2002, 14,000 people 2012, 15,000 people 2022, 17,000 people 2. For each year, the program should display the year with a bar consisting of one asterisk for each 1000 people. 3. Each time the loop is performed (that is, each time the loop iterates) one of the year values is displayed with asterisks next to it. That is: 1st time loop is performed/iterates the year 1922 and the correct number of asterisks should be displayed. 2nd time loop is performed/iterates the year 1942 and the correct number of asterisks should be displayed. 3rd time loop is performed/iterates the year 1962 and the correct number of asterisks should be displayed. etc. Program I/O. Input: None. Output should be in a table like format that looks similar to this: Prairieville Population Growth (each * represents 1000 people) ============================================================== 1922 ** 1942 **** 1962 ***** 1982 ********* 2002 ************** 2012 ******** ******* 2022 ****************

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter18: Stacks And Queues
Section: Chapter Questions
Problem 16PE: The implementation of a queue in an array, as given in this chapter, uses the variable count to...
icon
Related questions
Question
Bar Graph, v 1.0
Purpose. The purpose of this lab is to produce a bar graph showing the population growth of a
city called Prairieville, California. The bar graph should show the population growth of the city
in 20 year increments for the last 100 years. The bar graph should be printed using a loop. The
loop can be either a while loop or a for loop.
Write a program called cityPopulation Graph.cpp to produce the bar graph.
Requirements.
1. Use these population values with their corresponding years:
1922, 2000 people
1942, 5000 people
1962, 6000 people
1982, 9000 people
2002, 14,000 people
2012, 15,000 people
2022, 17,000 people
2. For each year, the program should display the year with a bar consisting of one asterisk for
each 1000 people.
3. Each time the loop is performed (that is, each time the loop iterates) one of
the year values is displayed with asterisks next to it. That is:
1st time loop is performed/iterates the year 1922 and the correct number of asterisks
should be displayed.
2nd time loop is performed/iterates the year 1942 and the correct number of asterisks
should be displayed.
3rd time loop is performed/iterates the year 1962 and the correct number of asterisks
should be displayed.
etc.
Program I/O. Input: None. Output should be in a table like format that looks similar to this:
Prairieville Population Growth (each
* represents 1000 people)
===
1922 **
1942 ****
1962 *****
1982 *********
2002 **************
2012 ******** *******
2022 ********* ******
===============
Transcribed Image Text:Bar Graph, v 1.0 Purpose. The purpose of this lab is to produce a bar graph showing the population growth of a city called Prairieville, California. The bar graph should show the population growth of the city in 20 year increments for the last 100 years. The bar graph should be printed using a loop. The loop can be either a while loop or a for loop. Write a program called cityPopulation Graph.cpp to produce the bar graph. Requirements. 1. Use these population values with their corresponding years: 1922, 2000 people 1942, 5000 people 1962, 6000 people 1982, 9000 people 2002, 14,000 people 2012, 15,000 people 2022, 17,000 people 2. For each year, the program should display the year with a bar consisting of one asterisk for each 1000 people. 3. Each time the loop is performed (that is, each time the loop iterates) one of the year values is displayed with asterisks next to it. That is: 1st time loop is performed/iterates the year 1922 and the correct number of asterisks should be displayed. 2nd time loop is performed/iterates the year 1942 and the correct number of asterisks should be displayed. 3rd time loop is performed/iterates the year 1962 and the correct number of asterisks should be displayed. etc. Program I/O. Input: None. Output should be in a table like format that looks similar to this: Prairieville Population Growth (each * represents 1000 people) === 1922 ** 1942 **** 1962 ***** 1982 ********* 2002 ************** 2012 ******** ******* 2022 ********* ****** ===============
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

The program should use only one loop. The loop can be either a while loop or a for loop, but it has to be one instead of two.

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Mergesort
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning