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 ****************

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education