question- Write a program to store 5 names and phone numbers in two different arrays. Write another program to search for contacts from the array.
answer-
names=[""]*5
numbers=[""]*5
for i in range(5):
names[i]=input("Enter name")
numbers[i]=input("Enter number")
user_input=input("Enter value to search")
for i in range(5):
if user_input==names[i]:
print(numbers[i])
need this converted to pseudocode**
Start
Declare array names(5)
Declare array numbers(5)
Declare variable user_input
for i=0 to 5
Display "Enter name"
Read names[i]
Display "Enter number"
Read numbers[i]
End for
Display "Enter value to search"
Read user_input
for i=0 to 5
if user_input=names[i] then
Display numbers[i]
End if
End for
Stop
Comments
thankyou :')
Leave a comment