Design Australia class and England class which inherit from Cricket class so that the following code provides the expected output. Note: Wicket Bonus = #of wicket * 1000 Century Bonus = #of century * 1000 addPlayerWithWickets and addPlayerWithCenturies methods should work any number of parameters assuming that the parameter number will be an even number and greater than 1. class Cricket: total_player = 0

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
Design Australia class and England class which inherit from
Cricket class
so that the following code provides the expected output.
Note:
Wicket Bonus = #of wicket * 1000
Century Bonus = #of century * 1000
addPlayerWithWickets and addPlayerWithCenturies methods
should work any
number of parameters assuming that the parameter number
will be an even
number and greater than 1.
class Cricket:
total_player = 0
def init(self, name, number):
self.name = name
self.number = number
def str(self):
s= "Name: "+self.name+", World Cup: "+self.number
return s
# Write your codes here.
# Do not change the following lines of code.
s1 = Australia("Australia", "5")
print("==============================")
sl.addPlayerWithWickets("Starc", 4, "Hazlewood", 3)
print("======
:========")
print(s1)
print("=====:
:==========")
s2 = England("England", "1")
print("==============================")
s2.addPlayerWithCenturies("Root", 5, "Ali", 3, "Woakes", 3)
print("===
:========")
print(s2)
print("==============================")
print("Total Players:", Cricket.total_player)
OUTPUT:
Australia has won world cups 5 time(s)
==============================
==============================
Name: Australia, World Cup: 5
Total Player(s): 2
Player Details:
Name: Starc, Wicket Bonus: 4000$
Name: Hazlewood, Wicket Bonus: 3000$
====
=====
===========
England has won world cups 1 time(s)
==============================
==========
==========
Name: England, World Cup: 1
Total Player(s): 3
Player Details:
Name: Root, Century Bonus: 5000$
Name: Ali, Century Bonus: 3000$
Name: Woakes, Century Bonus: 3000$
=====
Total Players: 5
Bhai qus
Transcribed Image Text:Design Australia class and England class which inherit from Cricket class so that the following code provides the expected output. Note: Wicket Bonus = #of wicket * 1000 Century Bonus = #of century * 1000 addPlayerWithWickets and addPlayerWithCenturies methods should work any number of parameters assuming that the parameter number will be an even number and greater than 1. class Cricket: total_player = 0 def init(self, name, number): self.name = name self.number = number def str(self): s= "Name: "+self.name+", World Cup: "+self.number return s # Write your codes here. # Do not change the following lines of code. s1 = Australia("Australia", "5") print("==============================") sl.addPlayerWithWickets("Starc", 4, "Hazlewood", 3) print("====== :========") print(s1) print("=====: :==========") s2 = England("England", "1") print("==============================") s2.addPlayerWithCenturies("Root", 5, "Ali", 3, "Woakes", 3) print("=== :========") print(s2) print("==============================") print("Total Players:", Cricket.total_player) OUTPUT: Australia has won world cups 5 time(s) ============================== ============================== Name: Australia, World Cup: 5 Total Player(s): 2 Player Details: Name: Starc, Wicket Bonus: 4000$ Name: Hazlewood, Wicket Bonus: 3000$ ==== ===== =========== England has won world cups 1 time(s) ============================== ========== ========== Name: England, World Cup: 1 Total Player(s): 3 Player Details: Name: Root, Century Bonus: 5000$ Name: Ali, Century Bonus: 3000$ Name: Woakes, Century Bonus: 3000$ ===== Total Players: 5 Bhai qus
Expert Solution
steps

Step by step

Solved in 4 steps with 2 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