Write a program that has 3 separate arrays: firstName, lastName, phone. Each array should should be populated with at least 10 entries and should include the 6 entries in the sample. The program...


Write a program that has 3 separate arrays: firstName, lastName, phone.  Each array should should be populated with at least 10 entries and should include the 6 entries in the sample. The program should allow the user to enter a name and then search to determine if the name is in the array and the number of the subscript location.  If found, the program should then display the first name, last name, and phone number. If not found, the computer should display a message saying "This name does not exist in database."


If the first name exists more than once in your array, it should print all entries that meet the search parameter


Use a loop to print all of the entries in your arrays.



Technical Requirements:



  • Include comments through out the program

  • Use if and if-elif-else where appropriate

  • Use 3 arrays

  • Use at least 2 loops, depending on your implementation, you may need more

  • Format output according to sample output data below

  • You must have at least 10 entries


In python


below is what i'm have already, having trouble with the part (if the first name exists more than once in your array, it should print all entries that meet the search parameter) its only pulling up one Chris


firstName = ['Chris','Diego','Edwin','Tinh','Chris','Marcos']
lastName = ['Martin','Garza','Stanford','Nguyen','Chamez','Stephens',]
phone = ['(392)234-6534','(483)451-1123','(713-543-8246','483-491-3864','253-582-1847','681-224-6521']


name = input("Enter a name to search: ")


if name in firstName:
n = firstName.index(name)
print(f'{name} {lastName[n]}, phone number : {phone[n]}')
else:
print(f'{name} is not in the list')



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here