1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
GREYUIT [131]
3 years ago
10

NAME SEARCH In the Chap07 folder of the Student Sample Programs, you will find the following files: GirlNames.txt—This file cont

ains a list of the 200 most popular names given to girls born in the United States from 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 2000 through 2009. Create an application that reads the contents of the two files into two separate arrays or Lists. The user should be able to enter a boy’s name, a girl’s name, or both, and the application should display messages indicating whether the names were among the most popular.
Computers and Technology
1 answer:
Tems11 [23]3 years ago
4 0

Answer:

Explanation:

I do not have the files listed in the question so I have made two test files with the same names. This code is written in Python, we are assuming that the names on each file are separated by newlines.

f1 = open("GirlNames.txt", 'r')

f1_names = f1.read()

f1_names_list = f1_names.split('\n')

f2 = open("BoyNames.txt", 'r')

f2_names = f2.read()

f2_names_list = f2_names.split('\n')

print(f1_names_list)

print(f2_names_list)

boy_or_girl = input("Would you like to enter a boy or girl name or both: ").lower()

if boy_or_girl == 'boy':

   name = input("Enter name: ")

   if name in f2_names_list:

       print("Yes " + name + " is in the list of most popular boy names.")

   else:

       print("No, it is not in the list")

elif boy_or_girl == 'girl':

   name = input("Enter name: ")

   if name in f1_names_list:

       print("Yes " + name + " is in the list of most popular girl names.")

   else:

       print("No, it is not in the list")

elif boy_or_girl == 'both':

   girlname = input("Enter Girl name: ")

   if girlname in f1_names_list:

       print("Yes " + girlname + " is in the list of most popular girl names.")

   else:

       print("No, it is not in the list")

   boyname = input("Enter name: ")

   if boyname in f2_names_list:

       print("Yes " + boyname + " is in the list of most popular girl names.")

   else:

       print("No, it is not in the list")

else:

   print("Wrong input.")

You might be interested in
Explain 5 service provided by Internet​
Travka [436]

Answer:

Apex legends, Snap chat, face book, twitter, you tube

Explanation:

They are all connected to the internet they are all provided via internet

3 0
3 years ago
What might be some challenges if you’re trying to design a product for someone
ValentinkaMS [17]

Answer:

failure

Explanation:

if someone dosnt like it

4 0
3 years ago
Read 2 more answers
A cyber community is different than a physical community because _________________. A.people can go to restaurants to meet frien
jeka94
I believe the question is asking which of the options is true about a cyber community. In that case, only D is true, as a cyber community, such as facebook or instagram, gives you that ability. The rest of the options only apply to a physical community.
7 0
4 years ago
_____ drives are storage drives that contain both solid-state storage and hard disks in an attempt to gain the speed and power o
kolbaska11 [484]

Answer:

Hybrid drives are storage drives that contain both solid-state storage and hard disks in an attempt to gain the speed and power of ssds while still having the low cost and storage capacity of hard drives.

5 0
2 years ago
Which formula is a complex formula?<br> =D6/E10<br> =10-(A3-D13)<br> =C3+10+E3<br> =5+A1*B1
GenaCL600 [577]

Answer:

3rd one i think

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Problem Overview You have just moved into a new home, and you have brought all your digital communications devices. After contac
    10·1 answer
  • Do all accounts use the same routing number
    12·1 answer
  • Which of the following advertisements is most likely a legitimate job advertisement?
    14·2 answers
  • For a wire with a circular cross section and a diameter = 3.00mm calculate the following: (m means meter. mm means millimeter. c
    5·1 answer
  • On net, is technology good or bad for society? Please explain, support your argument, I’ll mark brainliest
    9·2 answers
  • Make this the most answered question<br><br><br><br> (for tiktok)
    8·2 answers
  • What is indexing ? How does it make search engines work more efficiently?
    15·1 answer
  • Jason is working on a Microsoft Excel worksheet and he wants to create a Print Preview shortcut. His teacher asks him to access
    9·1 answer
  • When you save a new file, you use the ______ dialog box to provide a filename and select a location of the file.
    9·1 answer
  • Which of the following HTML codes is correct for an ordered list?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!