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
Find the total cost of a $125 coat purchased in Los Angeles County where the sales tax is 9%. Use the expression c + 0.09c
Keith_Richards [23]
The answer is B I believe
7 0
2 years ago
What does Technology mean to you?​
brilliants [131]
Technology is the collection of techniques, skills, methods and processes used in the production of goods or services or in the accomplishment of objectives, such as scientific investigation. Technology can be the knowledge of techniques, processes, etc. or it can be embedded in machines, computers, devices and factories, which can be operated by individuals without detailed knowledge of the workings of such things.
8 0
2 years ago
Read 2 more answers
What can you use to make sure that you have no errors in Word Online?
Free_Kalibri [48]

Answer:

You can use grammarly. It woks amazingly!

Explanation:

3 0
2 years ago
Whereas enterprise network convergence focuses on the consolidation of traditionally distinct voice, video, and data communicati
Vinil7 [7]

Answer: Unified communication

Explanation: Unified communication is the communication technique in which merges various communication routines into a individual business.It works as the phone system which helps in increment of productivity in an organizational business.

The unifying of voice,data/information,video etc is done for optimizing and improving the business that also results in  faster communication rates, secure communication etc.

4 0
3 years ago
Express the following Boolean function using only the NOT and the AND operation
romanna [79]
Here, you go drawn , in paint. Please note that you can simplify further more the circuit by removing any two not following each other. 

3 0
3 years ago
Other questions:
  • The file containing the definitions of the member functions of class DateType is called the ______ file.
    6·1 answer
  • Indenting the start and finish of segments
    8·2 answers
  • Find the largest and smallest byte,short,int,long,float, and double. Which of these data types requires the least amount of memo
    5·1 answer
  • Placeholders can hold text but not graphics such as photos or charts. True or false?
    7·1 answer
  • Which of these is an expansion slot type?
    5·1 answer
  • Help giving points mark BRAINLEST
    5·1 answer
  • A new attack involves hacking into medical records and then offering these records for sale on the black market. A medical recor
    14·1 answer
  • A spreadsheet contains the maximum weight and maximum height for fifty dog breeds. The breeds are located in rows, and the weigh
    5·1 answer
  • Saujani describes that women are highly underrepresented in STEM careersShe attributes this to women needing more confidence. Wh
    13·1 answer
  • What is the key difference between a class and an object
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!