CS192 Grantham WeeK5 Coding: Team Management OOP Style Assignment


Grantham University

Question Description

I coded a program for a team management roster last week. This week I need to convert my list to dictionary and while loop to for loop.

Team Management OOP Style

Your program for keeping track of team members is coming along, but now you want to be able to include phone numbers and jersey numbers along with your team member’s name. Modify your program from week 4 so that the program utilizes object-oriented programming to create a member object which can accept the player’s name, phone number, and jersey number. You will need to replace the list with a dictionary to help in locating objects for removal and editing. Again, File Access for long-term storage is not required for this assignment.

For this project:

  • You will submit your python code in either the original .py file, or copied into a .txt file.
  • A screenshot of your code having been executed (run). How to Take a Screenshot

Tips: While dictionaries resemble lists, remember that they are not the same! It is better to use FOR loops, not WHILE loops with index values.

Your class structure does not need a full set of accessor and mutator methods getName(), setName(newName), however it they will be helpful in the next week.

Unformatted Attachment Preview

print('Welcome to the Team Manager') memberList = [] while True: print('===========Main Menu===========') print('1. Display Team Roster.') print('2. Add Member.') print('3. Remove Member.') print('4. Edit Member.') print('9. Exit Program.') choice = input('Selection > ') i = 0 if choice == '1': for i in range(len(memberList)): print(memberList[i], " ") elif choice == '2': name = input("Enter new member name: ") memberList.append(name) phone = input("Enter new member's phone number: ") memberList.append(phone) jersey = input("Enter new member's jersey number: ") memberList.append(jersey) elif choice == '3': name = input('Enter member name to be removed: ') memberList.remove(name) memberList.remove(phone) memberList.remove(jersey) elif choice == '4': name = input('Enter the name of the member you want to edit: ') while True: \ print("===========Edit Member Menu===========") print("4.1 Change Name of Member") print("4.2 Change Member's Phone Number.") print("4.3 Change Member's Jersey Number.") print("4.4 Return to Main Menu") choice = input('Selection > ') if choice == '4.1': newName = input("Enter the new name of the member: ") if choice == '4.2': newPhone = input("Enter player's new phone number: if choice == '4.3': newJersey = input("Enter player's new jersey number: ") if choice == '4.4': break for i in range(len(memberList)): if memberList[i] == name: memberList[i] = newName if memberList[i] == phone: memberList[i] = newPhone if memberList[i] == jersey: memberList[i] = newJersey elif choice == '9': print("Exiting program....") exit() ") ...
Purchase answer to see full attachment

Final Answer

Hi buddy, i have fin...

GitHub (998)
New York University

I was on a very tight deadline but thanks to Studypool I was able to deliver my assignment on time.

The tutor was pretty knowledgeable, efficient and polite. Great service!

I did not know how to approach this question, Studypool helped me a lot.


Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors