Question: here is the sample transcript [P]rint contacts, [S]earch contacts, [Q]uit: p ---------------------CONTACTS--------------------- Daniel DeFrance.......................406-994-1624 Champ.....................................unlisted John Paxton, Department Head..........406-994-5979 Waded Cruzado, President..............406-994-CATS -------------------------------------------------- [P]rint contacts,

 here is the sample transcript [P]rint contacts, [S]earch contacts, [Q]uit: p

---------------------CONTACTS--------------------- Daniel DeFrance.......................406-994-1624 Champ.....................................unlisted John Paxton, Department Head..........406-994-5979 Waded Cruzado, President..............406-994-CATS --------------------------------------------------[P]rint contacts, [S]earch contacts, [Q]uit: s Search for contact: dan Daniel DeFrance.......................406-994-1624

here is the sample transcript

[P]rint contacts, [S]earch contacts, [Q]uit: p

---------------------CONTACTS--------------------- Daniel DeFrance.......................406-994-1624 Champ.....................................unlisted John Paxton, Department Head..........406-994-5979 Waded Cruzado, President..............406-994-CATS --------------------------------------------------

[P]rint contacts, [S]earch contacts, [Q]uit: s

Search for contact: dan Daniel DeFrance.......................406-994-1624

[P]rint contacts, [S]earch contacts, [Q]uit: s

Search for contact: 99 Daniel DeFrance.......................406-994-1624 John Paxton, Department Head..........406-994-5979 Waded Cruzado, President..............406-994-CATS

[P]rint contacts, [S]earch contacts, [Q]uit: s

Search for contact:

[P]rint contacts, [S]earch contacts, [Q]uit: q

Lab 7: OOP Contacts App Logistics Partner Information: Complete this assignment individually. Submission Instructions: Upload your solution, renamed to Your FirstName- YourLastName-Lab7.py to the BrightSpace Lab 7 Dropbox. Deadline Reminder: Once this deadline passes, BrightSpace will no longer accept your Python submission and you will no longer be able to earn credit. Thus, if you are not able to fully complete the assignment, submit whatever you have before the deadline so that partial credit can be earned. Learning Outcome Gain experience with object oriented programming and formatting output. Assignment A smartphone's contacts app has the ability to save contact information. In this assignment, you will simulate the contact list for a very simple contacts app. Download lab7.py below, rename it according to the instructions above, and make sure you understand it. Take the program above and modify it by completing the missing Contact class such that when the program is run, it can produce the sample transcript output Hint: for help on formatting output, revisit the online textbook's chapter 9.5.1 Grading - 10 points 2 points - The constructor of the Contact class is correct. (initializes the following 5 attributes): self.first_name self.last_name self.full_name self.phone_num o self.title (this should be initialized to the empty string) 2 points - The getter methods of the Contact class are correct (a getter for all five attributes) 2 points - The setter methods of the Contact class are correct (a setter for four attributes -- all but full_name) 4 points - Your program's output matches the output format of the transcript below (1 point for each type of difference up to 4 points). class Contact: Contact class for representing and manipulating contacts def init (self, first, last, phone): """A constructor to initialize Contact attributes""" pass # TODO: initialize contact attributes first_name, last_name, title, full_name, phone_number # TODO: add getter and setter methods def print_entry (self): """method to print contact""" space = 50 - len(self.full_name) print (self.full_name = self.phone_number.rjust(space, '.')) # Do not change anything below this line # def print_directory (contacts): print("CONTACTS".center (50, '-')) for person in contacts: person.print_entry() print("".center (50, '-')) # def search_contacts (contacts): search_string = input ("Search for contact: ") found = False if search_string == "": return 0 for contact in contacts: if (search_string.lower() in contact.get_full_name ().lower()): contact.print_entry() found = True if (search_string.lower() in contact.get_phone_number().lower()): contact.print_entry() found = True if not found: print("Search string not found.") # def main(): prof = Contact ("Daniel", "De France", "406-994-1624") mascot = Contact ("Bobcat", "" "unlisted") mascot.set_first_name ("Champ") def main(): prof = Contact ("Daniel", "De France", "406-994-1624") mascot = Contact ("Bobcat", "" "unlisted") mascot.set_first_name ("Champ") cs_dept_head = Contact("John", "Paxton", "406-994-5979") cs_dept_head.set_title("Department Head") president = Contact ("Waded", "Cruzado", "406-994-CATS") president.set_title("President") contacts = (prof, mascot, cs_dept_head, president] done = False while not done: print() user_input = input ("[P]rint contacts, [S]earch contacts, [Q] uit: ") if user_input.lower() == 'p': print() print_directory (contacts) elif user input.lower() == 's': print) search_contacts (contacts) elif user_input. lower() == 'a': done = True else: print ("Enter P, S, or o") main()

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!