Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question

#ClubMember class
class ClubMember:

#__init_ function
def __init__(self,id,name,gender,weight,phone):
self.id = id
self.name = name
self.gender = gender
self.weight = weight
self.phone = phone

#__str__ function
def __str__(self):
return "Id:"+str(self.id)+",Name:"+self.name+",Gender:"+self.gender+",Weight:"+str(self.weight)+",Phone:"+str(self.phone)


#Club class
class Club:

#__init__ function
def __init__(self,name):
self.name = name
self.members = {}
self.membersCount = 0

def run(self):
print("Welcome to "+self.name+"!")
while True:
print("""
1. Add New Member
2. View Member Info
3. Search for a member
4. Browse All Members
5. Edit Member
6. Delete a Member
7. Exit
""")

choice = int(input("Choice:"))

if choice == 1:
self.membersCount = self.membersCount+1
id = self.membersCount
name = input("Member name:")
gender = input("Gender:")
weight = int(input("Weight:"))
phone = int(input("Phone No."))

member = ClubMember(id,name,gender,weight,phone)
self.members[id] = member
elif choice == 2:
name = input("Enter name of member:")
members= self.members
for id,member in members.items():
if name == member.name:
print(member)
break
elif choice == 3:
id = int(input("Enter member id to search:"))
member = self.members[id]
print(member)
elif choice == 4:
print("Details of All members:")
for member in self.members.values():
print(member)
elif choice == 5:
id = int(input("Enter id of member to edit:"))
self.members[id].weight = int(input("Enter new weight of member:"))
self.members[id].phone = int(input("Enter new phone no. of member:"))
elif choice == 6:
id = int(input("Enter id of member to delete:"))
del self.members[id]
elif choice == 7:
break

 

 

my code is still providing indent errors and when i feel like ive done all the indents it still gives me errors

 

Develop a Python script that processes object records. Read and write records from data file using
pickle module.
Specifications:
Develop a tracking system for a Weight Loss Club. The system maintains and tracks membership
Information for club members.
The member-level information includes:
1. Member full name
2. Member ID
3. Gender
4. Weight
5. Phone (хxx-ххх-хххх format)
The club-level operations include: (Menu driven)
1. Add New Member – Create a new membership account
2. Delete a Member – Remove a member from the club
3. Search for a member - Search by Member ID
4. Browse All Members – Display all members in the club
5. Edit Member – Update a specific member info (weight change, phone change)
7. Exit the application
(You could refer to SavingsAccount and Bank classes and use a dictionary to store all accounts).
expand button
Transcribed Image Text:Develop a Python script that processes object records. Read and write records from data file using pickle module. Specifications: Develop a tracking system for a Weight Loss Club. The system maintains and tracks membership Information for club members. The member-level information includes: 1. Member full name 2. Member ID 3. Gender 4. Weight 5. Phone (хxx-ххх-хххх format) The club-level operations include: (Menu driven) 1. Add New Member – Create a new membership account 2. Delete a Member – Remove a member from the club 3. Search for a member - Search by Member ID 4. Browse All Members – Display all members in the club 5. Edit Member – Update a specific member info (weight change, phone change) 7. Exit the application (You could refer to SavingsAccount and Bank classes and use a dictionary to store all accounts).
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY