Question: Advanced Programming with Python Quiz #5 - Object Oriented Programming & Regular Expressions Regarding the 12th week examples we completed in the class, you are

 Advanced Programming with Python Quiz #5 - Object Oriented Programming &

Advanced Programming with Python

Quiz #5 - Object Oriented Programming & Regular Expressions Regarding the 12th week examples we completed in the class, you are asked to continue on the Person class with the following requirements according to the UML diagram given below: Person + name: str + surname: str + age: int + phone: str + password: str + __init__(name, surname, age, phone, password) +_init__(name, surname, age, phone) + check name(name): void + check_surname(surname): void + check_phone(phone): void + check password(password): void + generate_random password(): str str: str 4 1 check.name(name) method checks if the name has at least 3 letters and nothing else in it. If it doesn't initialize the instance name as "UNKNOWN". If it does capitalize the first letter of the name 2. check surname(sucname) method checks if the surname has at least 3 letters and nothing else in it. If it doesn't initialize the instance name as "UNKNOWN". If it does, capitalize the ficst letter of the surname 3. check phone(Rhone) method should check the phone number fort he following format: +90- 212-381-0000. If it doesn't initialize the instance Rhone as "WRONG FORMAT" check password(password) method should check if the password contains letters and digits. and symbols has a of 10. If not, initialize ance sword "1234567890 5. generate random password should generate a random Rassword and return it. The genecated password should contain at least 2 upper sase letters: 2 lower case letters: 2 symbols, and 2 numbers. The password should be 10 characters in total. 6 _str_ method is up to you. Print out all the info of the Person instance according to your desired output The check functions should be called from the appropriate constuctors and the Person instance should have his name, surname, phone, password checked immediately after he is created. If he doesn't have a password, he should be given one immediately. Your code should pass the following test cases: p1 = Person("duygu","cakir, 35, +90-212-381-0542", "ab45AB+%&) print(p1) p2 = Person("metin", yenidogan", 36, +90-212-381-00) print(p2)

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!