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
How to revive a computer if it functions in an unexpected manner?
julsineya [31]
This would depend on the issue the computer is having. 

In many cases though a simple reboot does the trick. 

If your computer is slow and glitches, try cleaning it for viruses and also clean the fans. If they are dusty the computer can overheat and that can cause it to slow while its working harder to cool down.

In other cases you may not be running the proper software compatible with your device, or programs may be outdated. Check online with the company that manufactured your computer to see if you need to install updates or change certain software. 

3 0
2 years ago
The pc card and cardbus devices are being replaced by what technology?
Ronch [10]
They are replaced by ExpressCard

3 0
2 years ago
In comparing a multi-boot environment and an environment using a type II hypervisor which offers the best performance? Which wou
ElenaW [278]

Answer / Explanation

To answer this question, let us first understand what a multi boot environment is and what an environment using a hypervisor is:

Multiple-booting can be defined or simply refers to the process of installing different multiple operating system on a single computer and also to be able to determine which of the operating systems boot per time.

While:

Hypervisor or a type 2 hypervisor can be described as a form of virtual machine in form of a software that is installed on in an existing operating system of a computer. One of the main benefit of an hypervisor is it enables easy navigation of guest on your computer without actually navigating into your original or primary operating system plus it aid in fast system recovery.

If we now refer back to the question asked in respect to which i would offer as the most convenience, i would prefer the type 2 hypervisor as convenient because i am able to run an operating system inside another operating system so navigating between two operating system would be very easy as compared to the Multi-booting where i have to always shut down an operating system to navigate between the operating system because i can only use one operating system per time.

4 0
3 years ago
You can add chart and axes titles on the chart tools format tab or with the chart elements buttom. true or false
Zepler [3.9K]
True. You can add chart and axes titles on the chart tools format tab or with the chart elements button.
4 0
2 years ago
In the INSERT statement that follows, assume that all of the table and column names are spelled correctly, that none of the colu
Firlakuza [10]

Answer:

The number of items in the column list doesn't match the number in the VALUES list.

Explanation:

The statement is:

INSERT INTO InvoiceCopy

(VendorID, InvoiceNumber, InvoiceTotal, PaymentTotal, CreditTotal,

TermsID, InvoiceDate, InvoiceDueDate)

VALUES

(97, '456789', 8344.50, 0, 0, 1, '2016-08-01');

As clearly seen, there are 8 number of items (VendorID, InvoiceNumber, InvoiceTotal, PaymentTotal, CreditTotal,  TermsID, InvoiceDate, InvoiceDueDate) but there are only 7 items in the values list.

Assuming the conditions given are true, it is seen the number of items in the column list does not match that of the values list, which identifies as a fault.

5 0
3 years ago
Other questions:
  • Engineers involved in product design and manufacturing use computer-aided design/computer-aided manufacturing (CAD/CAM) systems,
    13·1 answer
  • Set-In-Order includes making changes to the layout of the area.A) TrueB) False
    12·1 answer
  • What method is used to manage contention-based access on a wireless network?
    7·1 answer
  • Why might a variable used for output have to be of a different type then a variable used for input? ​
    12·1 answer
  • Write a Unix (Linux) find-like command (myFind) in Python3 where the function will return the full paths of all the files contai
    9·1 answer
  • Explain what middleware is. Name a common middleware in two-tier client/server architecture for database applications.
    10·1 answer
  • Write a program that will open a file named thisFile.txt and write every other line into the file thatFile.txt. Assume the input
    7·1 answer
  • What are two advantages of a pay-for-use online conferencing service compared to a free service? (Choose two)
    5·1 answer
  • Arturo is a security professional. He is strengthening the security of an information system. His design ensures that if a field
    10·1 answer
  • 8.1.4: Ghost Invasion!
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!