2. Design a Destroyer and Person class so the following driver code generates the given output upon execution. A Person has only "name" as its property which is publicly accessible and has a few public functions. All the properties (or variables) of a Destroyer object, on the other hand, are private. The variables are chars - a string containing all the characters that a particular Destroyer object will remove from a Person's name and replace_chars - a string with which each character in chars will be replaced from a Person's name. You may use the class diagram given below. Destroyer -chars: str -replace_chars: str _init(): None Driver Code: john Person ("John") alberta = Person ("Alberta") print (john, alberta) 0: Person v_kill= Destroyer ("aeiou") v_kill (john) print (john, alberta) print (caitlin) v_kill (caitlin).show_name() alberta.show_name() Alberta Alberta Ciin ON Output: John Alberta Destroyed: 'o' from Jihn's name. Jähn Alberta Jhn Alberta alpha_kill= Destroyer ("".join(chr(i) for i in range (65, 91)), "") print (john, alberta) alpha_kill (john) print (john, alberta) alberta.push_name (john) print (john, alberta) caitlin = Person ("Caitlin") john.attack (caitlin) Destroyed: 'h', 'j', 'n' from #'s name. # Alberta ON Destroyed: 'i' from C##n's name. Hello, I am C# #n Hello, I am Alberta Person name str _init__(): None _str_0 str +push_name(): None + pull_name(): None show_name(): None attack(): None
2. Design a Destroyer and Person class so the following driver code generates the given output upon execution. A Person has only "name" as its property which is publicly accessible and has a few public functions. All the properties (or variables) of a Destroyer object, on the other hand, are private. The variables are chars - a string containing all the characters that a particular Destroyer object will remove from a Person's name and replace_chars - a string with which each character in chars will be replaced from a Person's name. You may use the class diagram given below. Destroyer -chars: str -replace_chars: str _init(): None Driver Code: john Person ("John") alberta = Person ("Alberta") print (john, alberta) 0: Person v_kill= Destroyer ("aeiou") v_kill (john) print (john, alberta) print (caitlin) v_kill (caitlin).show_name() alberta.show_name() Alberta Alberta Ciin ON Output: John Alberta Destroyed: 'o' from Jihn's name. Jähn Alberta Jhn Alberta alpha_kill= Destroyer ("".join(chr(i) for i in range (65, 91)), "") print (john, alberta) alpha_kill (john) print (john, alberta) alberta.push_name (john) print (john, alberta) caitlin = Person ("Caitlin") john.attack (caitlin) Destroyed: 'h', 'j', 'n' from #'s name. # Alberta ON Destroyed: 'i' from C##n's name. Hello, I am C# #n Hello, I am Alberta Person name str _init__(): None _str_0 str +push_name(): None + pull_name(): None show_name(): None attack(): None
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...
Related questions
Question
it would be helpful if the code could be in a litle bit easy and no high level funtions not to be used
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images
Recommended textbooks for you
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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
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
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY