Question: Part 2: Name and Email Addresses Write a program that keeps names and email addresses in a dictionary as key-value pairs. The program should display

Part 2: Name and Email Addresses

Write a program that keeps names and email addresses in a dictionary as key-value pairs. The program should display a menu as shown in the sample output(s) that lets the user look up a persons email address, add a new name and email address, change an existing email address, and delete an existing name and email address. The program should pickle the dictionary and save it to a file named as emails.dat when the user exits the program. Each time the program starts, it should retrieve the dictionary from the file and unpickle it. When the program starts for the first time, the file doesnt exist and thus it needs to create an empty dictionary.

Output(s)

Menu

----------------------------------------

1. Look up an email address

2. Add a new name and email address

3. Change an existing email address

4. Delete a name and email address

5. Quit the program

Enter your choice: 2

Enter name: John Smith

Enter email address: JohnSmith@email.com

Name and address have been added.

Menu

----------------------------------------

1. Look up an email address

2. Add a new name and email address

3. Change an existing email address

4. Delete a name and email address

5. Quit the program

Enter your choice: 1

Enter a name: John Smith

Name: John Smith

Email: JohnSmith@email.com

Menu

----------------------------------------

1. Look up an email address

2. Add a new name and email address

3. Change an existing email address

4. Delete a name and email address

5. Quit the program

Enter your choice: 3

Enter name: John Smith

Enter the new address: JohnSmith01@email.com

Information updated.

Menu

----------------------------------------

1. Look up an email address

2. Add a new name and email address

3. Change an existing email address

4. Delete a name and email address

5. Quit the program

Enter your choice: 1

Enter a name: John Smith

Name: John Smith

Email: JohnSmith01@email.com

Menu

----------------------------------------

1. Look up an email address

2. Add a new name and email address

3. Change an existing email address

4. Delete a name and email address

5. Quit the program

Enter your choice: 4

Enter name: John Smith

Information deleted.

Menu

----------------------------------------

1. Look up an email address

2. Add a new name and email address

3. Change an existing email address

4. Delete a name and email address

5. Quit the program

Enter your choice: 1

Enter a name: John Smith

The specified name was not found.

Menu

----------------------------------------

1. Look up an email address

2. Add a new name and email address

3. Change an existing email address

4. Delete a name and email address

5. Quit the program

Enter your choice: 5 Information saved.

PLEASE INCLUDE PROGRAM PLAN (PSEUDOCODE) AND COMMENTS.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!