Python Question Implement the Player class with necessary properties so that the given  output is produced. Hints: First parameter of calculate_earning method is #played match and second  parameter is #goal Earning of Forward = #played match * 400 + #goal * 50 Earning of Defender = #played match * 400 + #goal * 40 You can not change any of the given code. #Write your code here Player.player_info() print('1.========================================') ronaldo = Player("Ronaldo", "Man United") print('2.----------------------------------------') ronaldo.calculate_earning(5, 7) print('3.----------------------------------------') print(ronaldo) print('4.========================================') ramos = Player("Ramos", "PSG", "Defender") print('5.----------------------------------------') ramos.calculate_earning(5, 1) print('6.----------------------------------------') print(ramos) print('7.========================================') pogba = Player("Pogba", "Man United") print('8.----------------------------------------') pogba.calculate_earning(5) print('9.----------------------------------------') print(pogba) print('10.========================================') Player.player_info() Output: Total Number of Player: 0 Total Number of Forward: 0 Total Number of Defender: 0 1.======================================== Creating a Forward. 2.---------------------------------------- 3.---------------------------------------- Player No: 1 Name: Ronaldo Team: Man United Position: Forward Earning: 2350$ 4.======================================== Creating a Defender. 5.---------------------------------------- 6.---------------------------------------- Player No: 2 Name: Ramos Team: PSG Position: Defender Earning: 2040$ 7.======================================== Creating a Forward. 8.---------------------------------------- 9.---------------------------------------- Player No: 3 Name: Pogba Team: Man United Position: Forward Earning: 2000$ 10.======================================== Total Number of Player: 3 Total Number of Forward: 2 Total Number of Defender: 1

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

Python Question
Implement the Player class with necessary properties so that the given 
output is produced.
Hints:
First parameter of calculate_earning method is #played match and second 
parameter is #goal
Earning of Forward = #played match * 400 + #goal * 50
Earning of Defender = #played match * 400 + #goal * 40
You can not change any of the given code.

#Write your code here
Player.player_info()
print('1.========================================')
ronaldo = Player("Ronaldo", "Man United")
print('2.----------------------------------------')
ronaldo.calculate_earning(5, 7)
print('3.----------------------------------------')
print(ronaldo)
print('4.========================================')
ramos = Player("Ramos", "PSG", "Defender")
print('5.----------------------------------------')
ramos.calculate_earning(5, 1)
print('6.----------------------------------------')
print(ramos)
print('7.========================================')
pogba = Player("Pogba", "Man United")
print('8.----------------------------------------')
pogba.calculate_earning(5)
print('9.----------------------------------------')
print(pogba)
print('10.========================================')
Player.player_info()

Output:
Total Number of Player: 0
Total Number of Forward: 0
Total Number of Defender: 0
1.========================================
Creating a Forward.
2.----------------------------------------
3.----------------------------------------
Player No: 1
Name: Ronaldo
Team: Man United
Position: Forward
Earning: 2350$
4.========================================
Creating a Defender.
5.----------------------------------------
6.----------------------------------------
Player No: 2
Name: Ramos
Team: PSG
Position: Defender
Earning: 2040$
7.========================================
Creating a Forward.
8.----------------------------------------
9.----------------------------------------
Player No: 3
Name: Pogba
Team: Man United
Position: Forward
Earning: 2000$
10.========================================
Total Number of Player: 3
Total Number of Forward: 2
Total Number of Defender: 1

Expert Solution
steps

Step by step

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