Example of populationdata.txt: Big Cities: Los Angeles, 382000000 San Diego,136000000 Small Towns: Long Beach, 362000 Irvine, 302000 Detroit, 606000 Specifications • You should submit a single file called M9A1.py • It should follow the submission standards outlined here: Submission Standards • Your program must declare an empty dictionary named population_dict. • Your program must populate population_dict within a while loop using the input() function to collect input from the user. • Your program must use print() statements to write to a file in the same directory named populationdata.txt. • You are not required to use try/exeception. Tips and Tricks • There are multiple ways to do this assignment. If you break it down into pieces you'll be fine. Hard-Coded Nothing is hard-coded for this file.

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
Example of populationdata.txt:
Big Cities:
Los Angeles, 382000000
San Diego, 136000000
Small Towns:
Long Beach, 362000
Irvine, 302000
Detroit, 606000
Specifications
• You should submit a single file called M9A1.py
• It should follow the submission standards outlined here: Submission Standards
• Your program must declare an empty dictionary named population_dict.
• Your program must populate population_dict within a while loop using the input() function to collect input from the user.
• Your program must use print() statements to write to a file in the same directory named populationdata.txt.
• You are not required to use try/exeception.
Tips and Tricks
• There are multiple ways to do this assignment. If you break it down into pieces you'll be fine.
Hard-Coded
Nothing is hard-coded for this file.
Transcribed Image Text:Example of populationdata.txt: Big Cities: Los Angeles, 382000000 San Diego, 136000000 Small Towns: Long Beach, 362000 Irvine, 302000 Detroit, 606000 Specifications • You should submit a single file called M9A1.py • It should follow the submission standards outlined here: Submission Standards • Your program must declare an empty dictionary named population_dict. • Your program must populate population_dict within a while loop using the input() function to collect input from the user. • Your program must use print() statements to write to a file in the same directory named populationdata.txt. • You are not required to use try/exeception. Tips and Tricks • There are multiple ways to do this assignment. If you break it down into pieces you'll be fine. Hard-Coded Nothing is hard-coded for this file.
Overview
This is a review assignment where you will use multiple tools you have picked up so far throughout the course. If you're confused about how to do something make sure you look back
at earlier assignments.
In this program you will start by declaring an empty dictionary named population_dict. Then you will use a while-loop to prompt a user for a series of cities and their populations,
storing the input in population_dict). After this you will prompt the user to decide what is the maximum population for a city to be considers a small down. Finally, you will open a file
called populationdata.txt where you will write the results.
Expected Output
Example of standard out (the console):
What is next city? (enter q to quit) Long Beach
What is the population of Long Beach? 362000
What is next city? (enter q to quit) Los Angeles
What is the population of Los Angeles? 382000000
What is next city? (enter q to quit) San Diego
What is the population of San Diego? 136000000
What is next city? (enter q to quit) Irvine
What is the population of Irvine? 302000
What is next city? (enter q to quit) Detroit
What is the population of Detroit? 606000
What is next city? (enter q to quit)
What is the largest population for a small town? 1000000
Transcribed Image Text:Overview This is a review assignment where you will use multiple tools you have picked up so far throughout the course. If you're confused about how to do something make sure you look back at earlier assignments. In this program you will start by declaring an empty dictionary named population_dict. Then you will use a while-loop to prompt a user for a series of cities and their populations, storing the input in population_dict). After this you will prompt the user to decide what is the maximum population for a city to be considers a small down. Finally, you will open a file called populationdata.txt where you will write the results. Expected Output Example of standard out (the console): What is next city? (enter q to quit) Long Beach What is the population of Long Beach? 362000 What is next city? (enter q to quit) Los Angeles What is the population of Los Angeles? 382000000 What is next city? (enter q to quit) San Diego What is the population of San Diego? 136000000 What is next city? (enter q to quit) Irvine What is the population of Irvine? 302000 What is next city? (enter q to quit) Detroit What is the population of Detroit? 606000 What is next city? (enter q to quit) What is the largest population for a small town? 1000000
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Lists
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