use python Implement the design of the Student and Lawyer class derived from Person  class so that the following code generates the output below: class Person:    def __init__(self, name, contact):      self.name = name      self.contact = contact    def __str__(self):      s = f"Name: {self.name}\nContact: {self.contact}"      return s #Write your code here john_cena = Student("John Cena", "9752325", 100005, "CSE") john_cena.add_courses("CSE111 Programming Language II", "CSE230 Discrete  Mathematics", "EEE101 Electrical Circuits 1") print("1.=========================================================") print(john_cena) print("2.=========================================================") john_cena.show_course_list("CSE") print("3.=========================================================") john_cena.show_course_list("ECE") print("4.=========================================================") john_cena.add_courses("ARC101 Design I: Basic Design") print("5.=========================================================") print(john_cena) print("6.=========================================================") saul_goodman = Lawyer("Saul Goodman", "5885858", "Dhaka") saul_goodman.add_client("Jesse Pinkman Criminal", "Walter White  Criminal", "John Cena Civil", "Naruto Uzumaki Civil") print("7.=========================================================") print(saul_goodman) OUTPUT: 1.========================================================= Student Details: Name: John Cena Contact: 9752325 ID: 100005 Department: CSE Courses List: {'CSE': ['CSE111 Programming Language II', 'CSE230 Discrete  Mathematics'], 'EEE': ['EEE101 Electrical Circuits 1']} 2.========================================================= Courses from CSE department: CSE111 Programming Language II CSE230 Discrete Mathematics 3.========================================================= John Cena did not take any course from ECE department 4.========================================================= 5.========================================================= Student Details: Name: John Cena Contact: 9752325 ID: 100005 Department: CSE Courses List: {'CSE': ['CSE111 Programming Language II', 'CSE230 Discrete  Mathematics'], 'EEE': ['EEE101 Electrical Circuits 1'], 'ARC': ['ARC101  Design I: Basic Design']} 6.========================================================= 7.========================================================= Lawyer Details: Name: Saul Goodman Contact: 5885858 Area: Dhaka Client List: {'Criminal': ['Jesse Pinkman Criminal', 'Walter White  Criminal'], 'Civil': ['John Cena Civil', 'Naruto Uzumaki Civil']}

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

use python

Implement the design of the Student and Lawyer class derived from Person 
class so that the following code generates the output below:

class Person:
   def __init__(self, name, contact):
     self.name = name
     self.contact = contact

   def __str__(self):
     s = f"Name: {self.name}\nContact: {self.contact}"
     return s
#Write your code here

john_cena = Student("John Cena", "9752325", 100005, "CSE")
john_cena.add_courses("CSE111 Programming Language II", "CSE230 Discrete 
Mathematics", "EEE101 Electrical Circuits 1")
print("1.=========================================================")
print(john_cena)
print("2.=========================================================")
john_cena.show_course_list("CSE")
print("3.=========================================================")
john_cena.show_course_list("ECE")
print("4.=========================================================")
john_cena.add_courses("ARC101 Design I: Basic Design")
print("5.=========================================================")
print(john_cena)
print("6.=========================================================")
saul_goodman = Lawyer("Saul Goodman", "5885858", "Dhaka")
saul_goodman.add_client("Jesse Pinkman Criminal", "Walter White 
Criminal", "John Cena Civil", "Naruto Uzumaki Civil")
print("7.=========================================================")
print(saul_goodman)

OUTPUT:
1.=========================================================
Student Details:
Name: John Cena
Contact: 9752325
ID: 100005
Department: CSE
Courses List:
{'CSE': ['CSE111 Programming Language II', 'CSE230 Discrete 
Mathematics'], 'EEE': ['EEE101 Electrical Circuits 1']}
2.=========================================================
Courses from CSE department:
CSE111 Programming Language II
CSE230 Discrete Mathematics
3.=========================================================
John Cena did not take any course from ECE department
4.=========================================================
5.=========================================================
Student Details:
Name: John Cena
Contact: 9752325
ID: 100005
Department: CSE
Courses List:
{'CSE': ['CSE111 Programming Language II', 'CSE230 Discrete 
Mathematics'], 'EEE': ['EEE101 Electrical Circuits 1'], 'ARC': ['ARC101 
Design I: Basic Design']}
6.=========================================================
7.=========================================================
Lawyer Details:
Name: Saul Goodman
Contact: 5885858
Area: Dhaka
Client List: {'Criminal': ['Jesse Pinkman Criminal', 'Walter White 
Criminal'], 'Civil': ['John Cena Civil', 'Naruto Uzumaki Civil']}

 
OUTPUT:
1.========
=D==D=D= ----
Student Details:
Name: John Cena
Contact: 9752325
ID: 100005
Department CSE
Courses List:
('CSE': ['CSE111 Programming Language Il', 'CSE230 Discrete
Mathematics], 'EEE': ['EEE101 Electrical Circuits 1'1}
2.========
Courses from CSE department:
CSE111 Programming Language II
CSE230 Discrete Mathematics
3.======================
John Cena did not take any course from ECE department
4.s====
5.=======
Student Details:
Name: John Cena
Contact: 9752325
ID: 100005
Department CSE
Courses List:
('CSE: ['CSE111 Programming Language Il", 'CSE230 Discrete
Mathematics'), 'EEE': ['EEE101 Electrical Circuits 1]. 'ARC': ['ARC101
Design I: Basic Design']}
6.===========
7.=========
Lawyer Details:
Name: Saul Goodman
Contact: 5885858
Area: Dhaka
Client List: {Criminal': ["Jesse Pinkman Criminal', "Walter White
Criminal'), 'Civil': ['John Cena Civil, 'Naruto Uzumaki Civil']}
Transcribed Image Text:OUTPUT: 1.======== =D==D=D= ---- Student Details: Name: John Cena Contact: 9752325 ID: 100005 Department CSE Courses List: ('CSE': ['CSE111 Programming Language Il', 'CSE230 Discrete Mathematics], 'EEE': ['EEE101 Electrical Circuits 1'1} 2.======== Courses from CSE department: CSE111 Programming Language II CSE230 Discrete Mathematics 3.====================== John Cena did not take any course from ECE department 4.s==== 5.======= Student Details: Name: John Cena Contact: 9752325 ID: 100005 Department CSE Courses List: ('CSE: ['CSE111 Programming Language Il", 'CSE230 Discrete Mathematics'), 'EEE': ['EEE101 Electrical Circuits 1]. 'ARC': ['ARC101 Design I: Basic Design']} 6.=========== 7.========= Lawyer Details: Name: Saul Goodman Contact: 5885858 Area: Dhaka Client List: {Criminal': ["Jesse Pinkman Criminal', "Walter White Criminal'), 'Civil': ['John Cena Civil, 'Naruto Uzumaki Civil']}
Implement the design of the Student and Lawyer class derived from Person
class so that the following code generates the output below:
class Person:
def _init_(self, name, contact):
self.name = name
self.contact = contact
def _str_(self):
s= "Name: {self.name}\nContact: (self.contact}"
return s
#Write your code here
john_cena = Student("John Cena", "9752325", 100005, "CSE")
john_cena.add_courses("CSE111 Programming Language Il", "CSE230 Discrete
Mathematics", "EEE101 Electrical Circuits 1")
print("1.=====
===")
print(john_cena)
print("2.==
john_cena.show_course_list("CSE")
=")
print("3.
john_cena.show_course_list("ECE")
print("4.===
==")
john_cena.add_courses("ARC101 Design I: Basic Design")
print("5.=
===")
print(john_cena)
print("6.=
=")
saul_goodman = Lawyer("Saul Goodman", "5885858", "Dhaka")
%3D
saul_goodman.add_client("Jesse Pinkman Criminal", "Walter White
Criminal", "John Cena Civil", "Naruto Uzumaki Civil")
print("7.====:
===")
print(saul_goodman)
Transcribed Image Text:Implement the design of the Student and Lawyer class derived from Person class so that the following code generates the output below: class Person: def _init_(self, name, contact): self.name = name self.contact = contact def _str_(self): s= "Name: {self.name}\nContact: (self.contact}" return s #Write your code here john_cena = Student("John Cena", "9752325", 100005, "CSE") john_cena.add_courses("CSE111 Programming Language Il", "CSE230 Discrete Mathematics", "EEE101 Electrical Circuits 1") print("1.===== ===") print(john_cena) print("2.== john_cena.show_course_list("CSE") =") print("3. john_cena.show_course_list("ECE") print("4.=== ==") john_cena.add_courses("ARC101 Design I: Basic Design") print("5.= ===") print(john_cena) print("6.= =") saul_goodman = Lawyer("Saul Goodman", "5885858", "Dhaka") %3D saul_goodman.add_client("Jesse Pinkman Criminal", "Walter White Criminal", "John Cena Civil", "Naruto Uzumaki Civil") print("7.====: ===") print(saul_goodman)
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY