Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

-- of 20 points Chapter 7: Auto-Graded Programming Project 1 Unlimited tries Assume the file popular names.txt contains the 400 most popular names given to

image text in transcribed
-- of 20 points Chapter 7: Auto-Graded Programming Project 1 Unlimited tries Assume the file popular names.txt contains the 400 most popular names given to children born in the United States from the year 2000 through 2009. The file contains 400 lines, with one name per line. Write a program that reads the contents of the file into a list. The program should display the following string to prompt the user to enter a name: 'Enter a name: ' The program should then display a message indicating whether the name is among the most popular. If the name is found in the list, the program should display the following message: 'That was a popular name between 2000 and 2009.' If the name is not found in the list, the program should display the following message: 'That was not a popular name between 2000 and 2009.' A Look carefully at the following sample runs of the program. In the first sample run, the user enters a name that is found in the list. In the second sample run, the user enters a name that is not found in the list. Carefully notice the wording of the messages and the placement of spaces and colons. Your program's output must match this. Sample Run (User input shown in bold) Enter a name: Isabella That was a popular name between 2000 and 2009. Sample Run (User input shown in bold) Enter a name: Voldemort That was not a popular name between 2000 and 2009

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

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions