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

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question

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')

 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage