Please give the thumbs up, if it is helpful for you!!. Let me know if you have any doubts.
"""
Created on Wed Oct 18 09:04:03 2017
@author:
"""
def create_contact(contacts,first,last,email,age,phone):
contacts[first+' '+last]=[email,age,phone]
def update_contact_number(contacts,first,last,phone):
contacts[first+' '+last][2]=phone
def update_contact_email(contacts,first,last,email):
contacts[first+' '+last][0]=email
def update_contact_age(contacts,first,last,age):
contacts[first+' '+last][1]=age
def get_contact_number(contacts,first,last):
return contacts[first+' '+last][2]
def get_contact_email(contacts,first,last):
return contacts[first+' '+last][0]
def get_contact_age(contacts,first,last):
return contacts[first+' '+last][1]
def contains_contact(contacts,first,last):
if first+' '+last in contacts.keys():
return True
else:
return False
def display(contacts,first,last):
if first+' '+last in contacts.keys():
print(first+' '+last)
print('Email: '+contacts[first+' '+last][0])
print('Phone: '+contacts[first+' '+last][2])
print('Age: '+str(contacts[first+' '+last][1]))
else:
print('Contact does not exist.')
def main():
contacts={}
create_contact(contacts,"Katie","Katz","[email protected]",25,"857-294-2758")
create_contact(contacts,"Jim","Jones","[email protected]",19,"525-866-2749")
create_contact(contacts,"Sarah","Sanders","[email protected]",18,"593-026-2532")
update_contact_number(contacts,"Katie","Katz","907-536-2946")
update_contact_age(contacts,"Sarah","Sanders",19)
update_contact_email(contacts,"Jim","Jones","[email protected]")
#print(get_contact_number(contacts,"Katie","Katz"))
#print(get_contact_age(contacts,"Sarah","Sanders"))
#print(get_contact_email(contacts,"Jim","Jones"))
#print(contains_contact(contacts,"Katie","Katz"))
#print(contacts)
print("Creation of Jim Jones: {}".format("Passed" if
contains_contact(contacts,"Jim","Jones") else "Failed"))
print("Creation of Katie Katz: {}".format("Passed" if
contains_contact(contacts,"Katie","kaTz") else "Failed"))
print("Creation of Sarah Sanders: {}".format("Passed" if
contains_contact(contacts,"Sarah","Sanders") else "Failed"))
print("Updating of Jim Jones: {}".format("Passed" if
get_contact_email(contacts,"Jim","Jones")=="[email protected]"
else "Failed"))
print("Updating of Katie Katz: {}".format("Passed" if
get_contact_number(contacts,"Katie","Katz")=="907-536-2946" else
"Failed"))
print("Updating of Sarah Sanders: {}".format("Passed" if
get_contact_age(contacts,"Sarah","Sanders")==19 else
"Failed"))
print()
display(contacts,"Katie","Katz")
print()
display(contacts,"George","Shaw")
main()
Output:
You should implement several functions that the Phone Contacts program will need Each function with take...
DESCRIPTION Create a C++ program to manage phone contacts. The program will allow the user to add new phone contacts, display a list of all contacts, search for a specific contact by name, delete a specific contact. The program should provide the user with a console or command line choice menu about possible actions that they can perform. The choices should be the following: 1. Display list of all contacts. 2. Add a new contact. 3. Search for a contact...
python Implement function get_contact(contacts, name) that returns a string. The contacts and the name parameter are both type string. This function checks for the name string in the contacts string and returns that person's contact information. If the person is not found, the function returns, "name not in contact". Assume input is always valid. Assume the same name is not repeated in contacts. [You may use split(), range(), len() ONLY and no other built-in function or method] Examples: contacts =...
Problem: Contact Information Sometimes we need a program that have all the contact information like name, last name, telephone, direction and something we need to know about that person (notes). Write a program in java language with GUI, classes, arrays, files and inheritance that make this possible. In the first layer, the user should see all the contacts and three buttons (add, delete, edit). *Add button: If the user click the button add, a new layer should appear and should...
language:python VELYIEW Design a program that you can use to keep information on your family or friends. You may view the video demonstration of the program located in this module to see how the program should function. Instructions Your program should have the following classes: Base Class - Contact (First Name, Last Name, and Phone Number) Sub Class - Family (First Name, Last Name, Phone Number, and Relationship le. cousin, uncle, aunt, etc.) Sub Class - Friends (First Name, Last...
Please help!! (C++ PROGRAM) You will design an online contact list to keep track of names and phone numbers. · a. Define a class contactList that can store a name and up to 3 phone numbers (use an array for the phone numbers). Use constructors to automatically initialize the member variables. b.Add the following operations to your program: i. Add a new contact. Ask the user to enter the name and up to 3 phone numbers. ii. Delete a contact...
This assignment was locked Mar 24 at 11:59pm. For this lab you will implement a phone book using a linked list to keep people's names and phone numbers organized in alphabetical order. 1. Define a structure to hold the contact information including: name, phone number, a pointer to the next node in the list. Example: struct ContactNode { string name; string phoneNumber; ContactNode *next; } 2. Define a class containing the structure and the appropriate methods to update and retrieve...
C++ In this assignment, you will write a class that implements a contact book entry. For example, my iPhone (and pretty much any smartphone) has a contacts list app that allows you to store information about your friends, colleagues, and businesses. In later assignments, you will have to implement this type of app (as a command line program, of course.) For now, you will just have to implement the building blocks for this app, namely, the Contact class. Your Contact...
In this assignment, you will create an application that holds a list of contact information. You will be able to prompt the user for a new contact, which is added to the list. You can print the contact list at any time. You will also be able to save the contact list. MUST BE IN PYTHON FORMAT Create the folllowing objects: ContactsItem - attributes hold the values for the contact, including FirstName - 20 characters LastName - 20 characters Address...
In this assignment, you will create an application that holds a list of contact information. You will be able to prompt the user for a new contact, which is added to the list. You can print the contact list at any time. You will also be able to save the contact list. Must Be In Python Format Create the following objects: ContactsItem - attributes hold the values for the contact, including FirstName - 20 characters LastName - 20 characters Address...
USING THIS CODE: #include <iostream> #include <string> using namespace std; class Contact { //this class cannot be viewed from outside of the private class. //only the class functions within the class can access private members. private: string name; string email; string phone; //the public class is accessible from anywhere outside of the class //however can only be within the program. public: string getName() const { return name; } void setName(string name) { this->name = name; } string getEmail() const {...