Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ You can use any data file for city population then I will fix it by using mine. City Populations ve of this lab is

C++
You can use any data file for city population then I will fix it by using mine. image text in transcribed
City Populations ve of this lab is compare the populations of various cities that lie in between and Dayton on I-75. Write a program that produces a bar illustrating the populations Toledo The program should read the name of the city and its population from a file. Have continue this process until the end of file is reached. For each city, your program the should display the name of the city and a bar consisting of one asterisk for every 2,000 mcople. For example, if a city's population is between 18,000 and 19,999, 9 asterisks should anpear in the bar. The data can be found in the pop.txt file located on Blackboard. For a hint on how to read data until the end of file is reached, look at the notes on repetition tructures (part 2) that we covered in class. Also look at the same class notes to review how print out a certain number of asterisks to the screen. The output should be formatted similar to the following: City Populations Perrysburg Bowling Green Findlay Huber Heights*** KEY: ) 2000 people Once finished with the above task, modify your program to allow the user to type in how many people each asterisk represents (for example, typing 5000 would make the bar for Findlay 8 asterisks long instead of 20). Finally, add code to your program to track the two cities in the file with the highest populations and list the results after the previously computed results. You can assume that no two cities have the same population

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

More Books

Students also viewed these Databases questions

Question

(vii) If A = [ }} a and B = [222] Find value of B' - 2A'.

Answered: 1 week ago

Question

Comment should this MNE have a global LGBT policy? Why/ why not?

Answered: 1 week ago