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
What is the keyboard shortcut for the Undo command?
Vanyuwa [196]

Answer:

CTRL+Z is Undo

Explanation:

CTRL+X: Cut

CTRL+Z: Undo

CTRL+U: Underline

CTRL+V: Paste

4 0
4 years ago
In most software programs, which color arrows selects the points in a vector
Inessa05 [86]

Answer:

in think gray is used as arrow color which selects the points in a vector

4 0
3 years ago
A(n) ________ CPU has two processing paths, allowing it to process more than one instruction at a time.
lions [1.4K]
C. Dual-core is the answer
3 0
4 years ago
Read 2 more answers
You have a small network at home that is connected to the internet. On your home network, you have a server with the IP address
oksian1 [2.3K]

Answer:

Answer C

Explanation:

Static NAT creates a fixed translation of private addresses to public addresses. The main difference between dynamic NAT and static NAT is that static NAT allows a remote host to initiate a connection to a translated host if an access list exists that allows it, while dynamic NAT does not.

5 0
3 years ago
explain the following joke: “There are 10 types of people in the world: those who understand binary and those who don’t.”
sasho [114]

It means that there are people  who understand binary and those that do not understand it. That is, binary is said to be the way that computers are known to express numbers.

<h3>What is the joke about?</h3>

This is known to be a popular  joke that is often  used by people who are known to be great savvy in the field of mathematics.

The joke is known to be one that makes the point that a person is implying that the phrase is about those who only understands the decimal system, and thus relies on numbers in groups of 10.

The binary system is one that relies on numbers that are known to be  in groups of 2.

Therefore, If the speaker of the above phrase is one who is able to understand binary, that person  would  be able to say that that the phrase  is correctly written as  "there are 2 types of people that understand binary".

Learn more about binary from

brainly.com/question/21475482

#SPJ1

7 0
2 years ago
Other questions:
  • Where can you access all the formatting options for worksheet cells?
    5·1 answer
  • can Results shown at the top of the Google search engine results page (SERP) always get high Needs Met ratings
    10·1 answer
  • Simple geometry can compute the height of an object from the the object's shadow length and shadow angle using the formula: tan(
    12·1 answer
  • What is an Action Button?
    10·1 answer
  • How to can you avoid becoming a victim of identity theft?
    10·1 answer
  • What will be result of below if statement.
    13·1 answer
  • Which statements about grades are accurate? Check all that apply. Grades help indicate how well a student is understanding a cer
    13·1 answer
  • A sum amounts to ₹2400 at 15% simple interest per annum after 4 years fond the sum.​
    9·1 answer
  • Answer the following questions which are based on the study "Patients' Engagement with Sweet Talk." Submit your answers.
    8·1 answer
  • Which practice enables recovery of accidental deletions in data records?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!