If you have downloaded the source code from this book's companion web site, you will find the following files in the Chapter 07 folder: • GirlNames.txt--This file contains a list of the 200 most popular names given to girls born in the United States from the year 2000 through 2009. • BoyNames.txt--This file contains a list of the 200 most popular names given to boys born in the United States from the year 2000 through 2009. Write a program that reads the contents of the two files into two separate lists, allows a user to input either a girl's name, a boy's name, or both, then tells the user whether the name(s) was/were popular between 2000 and 2009. First, the program should prompt the user to choose a girl's name, a boy's name, or both by entering either 'girl', 'boy', or 'both.' Once they have chosen, they should be able to input a name. If the name was a popular name, like Jacob or Sophia, the program should print "Jacob was a popular boy's name between 2000 and 2009." or "Sophia was a popular girl's name between 2000 and 2009." If the name was not a popular name, like Voldemort, the program should print "Voldemort was not a popular boy's name between 2000 and 2009." If the user chooses to input both a girl and boy's name, ask for the boy's name, then the girl's name, and print two statements in the form mentioned above on two separate lines, with the statement about the boy's name coming first. For example, if the user inputs Voldemort and then Sophia, print: Voldemort was not a popular boy's name between 2000 and 2009. Sophia was a popular girl's name between 2000 and 2009. solve in pytho

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

If you have downloaded the source code from this book's companion web site, you
will find the following files in the Chapter 07 folder:

• GirlNames.txt--This file contains a list of the 200 most popular names given to
girls born in the United States from the year 2000 through 2009.
• BoyNames.txt--This file contains a list of the 200 most popular names given to
boys born in the United States from the year 2000 through 2009.

Write a program that reads the contents of the two files into two separate
lists, allows a user to input either a girl's name, a boy's name, or
both, then tells the user whether the name(s) was/were popular between 2000 and
2009.

First, the program should prompt the user to choose a girl's name, a boy's name,
or both by entering either 'girl', 'boy', or 'both.'

Once they have chosen, they should be able to input a name. If the name was
a popular name, like Jacob or Sophia, the program should print "Jacob was a
popular boy's name between 2000 and 2009." or "Sophia was a popular girl's name
between 2000 and 2009."

If the name was not a popular name, like Voldemort, the program should print
"Voldemort was not a popular boy's name between 2000 and 2009."

If the user chooses to input both a girl and boy's name, ask for the boy's name,
then the girl's name, and print two statements in the form mentioned above on
two separate lines, with the statement about the boy's name coming first.
For example, if the user inputs Voldemort and then Sophia, print:

Voldemort was not a popular boy's name between 2000 and 2009.
Sophia was a popular girl's name between 2000 and 2009.

solve in python

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
File Input and Output Operations
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.
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