Your program is going to create a searchable contact list. The program should read names and phone numbers entered from the keyboard and store them in two different parallell lists. Step 1: You do not know how many names/numbers will be entered so your program will first ask the user how many names/numbers will be entered. Step 2: Your program will then have a for loop that uses that number to control how many times it repeats the following steps (3-4). Step 3: Within the for loop your program should ask for and input the name and ask for and input the phone number. Step 4: Within the loop, each name should be stored in a names list and each number should be stored in a phone number list. Step 5: After all the information has been entered and the for loop ends, your program will display a nicely formatted table with a list of all the names and phone numbers. See sample output below Step 6: After displaying the contacts, your program should task the user if all the phone numbers are correct. If the user answers "no" , the program will ask the user for the name of the person whose number is wrong and also ask for the correct number. Using the index method of the list class, your program will find the index position of where the name is in the names list so that you can use that index to change the corresponding phone number in the phone number list with the corrected phone number the user entered. See slides 15 powerpoint PP3 and slide 24 PP4 for an example of the index method. as well as an example of changing a value in a list. If there has been a change in the list display again each name and phone number in the corrected list. See sample output below: Sample run1: How many names and phone numbers do you want to enter? 5 Enter the name Tom Enter the number 972-234-7777 Enter the name Joe Enter the number 213-660-9484 Enter the name Sam Enter the number 675-222-4545 Enter the name Henry Enter the number 456-790-6650 Enter the name Jack Enter the number 213-456-7890 Here is your contact list: Tom 972-234-7777 Joe 213-660-9484 Sam 675-222-4545 Henry 456-790-6650 Jack 213-456-7890 Are all the phone numbers correct? Yes Sample run 2: How many names and phone numbers do you want to enter? 3 Enter the name Jane Enter the number 234-5678 Enter the name Joe Enter the number 213-660-9484 Enter the name Sally Enter the number 675-222-4545 Here is your contact list: Jane 234-5678 Joe 213-660-9484 Sally 675-222-4545 Are all the phone numbers correct? No Enter the name of the person whose number needs to be corrected Jane Enter the correct phone number for Jane 214-234-5678 Here is your corrected contact list: Jane 214-234-5678 Joe 213-660-9484 Sally 675-222-4545
Operations
In mathematics and computer science, an operation is an event that is carried out to satisfy a given task. Basic operations of a computer system are input, processing, output, storage, and control.
Basic Operators
An operator is a symbol that indicates an operation to be performed. We are familiar with operators in mathematics; operators used in computer programming are—in many ways—similar to mathematical operators.
Division Operator
We all learnt about division—and the division operator—in school. You probably know of both these symbols as representing division:
Modulus Operator
Modulus can be represented either as (mod or modulo) in computing operation. Modulus comes under arithmetic operations. Any number or variable which produces absolute value is modulus functionality. Magnitude of any function is totally changed by modulo operator as it changes even negative value to positive.
Operators
In the realm of programming, operators refer to the symbols that perform some function. They are tasked with instructing the compiler on the type of action that needs to be performed on the values passed as operands. Operators can be used in mathematical formulas and equations. In programming languages like Python, C, and Java, a variety of operators are defined.
Your program is going to create a searchable contact list. The program should read names and phone numbers entered from the keyboard and store them in two different parallell lists.
Step 1: You do not know how many names/numbers will be entered so your program will first ask the user how many names/numbers will be entered.
Step 2: Your program will then have a for loop that uses that number to control how many times it repeats the following steps (3-4).
Step 3: Within the for loop your program should ask for and input the name and ask for and input the phone number.
Step 4: Within the loop, each name should be stored in a names list and each number should be stored in a phone number list.
Step 5: After all the information has been entered and the for loop ends, your program will display a nicely formatted table with a list of all the names and phone numbers. See sample output below
Step 6: After displaying the contacts, your program should task the user if all the phone numbers are correct. If the user answers "no" , the program will ask the user for the name of the person whose number is wrong and also ask for the correct number. Using the index method of the list class, your program will find the index position of where the name is in the names list so that you can use that index to change the corresponding phone number in the phone number list with the corrected phone number the user entered.
See slides 15 powerpoint PP3 and slide 24 PP4 for an example of the index method. as well as an example of changing a value in a list.
If there has been a change in the list display again each name and phone number in the corrected list. See sample output below:
Sample run1:
How many names and phone numbers do you want to enter?
5
Enter the name
Tom
Enter the number
972-234-7777
Enter the name
Joe
Enter the number
213-660-9484
Enter the name
Sam
Enter the number
675-222-4545
Enter the name
Henry
Enter the number
456-790-6650
Enter the name
Jack
Enter the number
213-456-7890
Here is your contact list:
Tom 972-234-7777
Joe 213-660-9484
Sam 675-222-4545
Henry 456-790-6650
Jack 213-456-7890
Are all the phone numbers correct?
Yes
Sample run 2:
How many names and phone numbers do you want to enter?
3
Enter the name
Jane
Enter the number
234-5678
Enter the name
Joe
Enter the number
213-660-9484
Enter the name
Sally
Enter the number
675-222-4545
Here is your contact list:
Jane 234-5678
Joe 213-660-9484
Sally 675-222-4545
Are all the phone numbers correct?
No
Enter the name of the person whose number needs to be corrected
Jane
Enter the correct phone number for Jane
214-234-5678
Here is your corrected contact list:
Jane 214-234-5678
Joe 213-660-9484
Sally 675-222-4545
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images