Question

python * important *

In this question, you will complete the FootballPlayer class, which is used to 
compute some features of a Football Player. The class should be constructed with
the name and age, as well as shooting, passing, tackling and saving skill 
points of a player. The constructor method as well as the defenderScore method 
is provided below. You should implement the remaining methods. The definitons 
of the methods are presented below as comments. 

An example execution and the corresponding outputs are provided below:

>>> burkay = FootballPlayer("Burkay", 42, 15, 30, 10, 15)

>>> cemil = FootballPlayer("Cemil", 30, 70, 30, 45, 20)

>>> ronaldo = FootballPlayer("Ronaldo", 36, 85, 95, 35, 5)

>>> print(burkay)
(Burkay,42,13640000)

>>> print(cemil)
(Cemil,30,144270000)

>>> print(ronaldo)
(Ronaldo,36,322445000)

>>> print(burkay > cemil)
False

>>> print(ronaldo > burkay)
True
"""

class FootballPlayer:
    def __init__(self, na, ag, sh, pa, ta, sa):
        # age is in [18,40]
        # skills are in [10,100]
        self.name = na
        self.age = ag
        self.shooting = sh
        self.passing = pa
        self.tackling = ta
        self.saving = sa

    def defenderScore(self):
        # The defensive score is defined as 80% tackling, 15% passing and 5% shooting
        # It should be reported as integer
        return int(0.80 * self.tackling + 0.15 * self.passing + 0.05 * self.shooting)

    def midfielderScore(self):
        # The midfielder score is defined as 50% passing, 25% shooting and 25% tackling
        # It should be reported as integer
        return # Remove this line to answer this question

    def forwardScore(self):
        # The forward score is defined as 70% shooting, 25% passing and 5% tackling
        # It should be reported as integer
        return # Remove this line to answer this question

    def goalieScore(self):
        # The goalie score is defined as 90% saving and 10% passing
        # It should be reported as integer
        return # Remove this line to answer this question

    def playerValue(self):
        # Player value is defined as 
        # * 15000$ per unit of the square of defensive score
        # * 25000$ per unit of the square of midfielder score
        # * 20000$ per unit of the square of forward score
        # * 5000$ per unit of the square of goalie score
        # * -30000$ per (age-26)^2
        # A player's value is never reported as negative. The minimum is 0.
        # It should be reported as integer
        return # Remove this line to answer this question


    def __str__(self):
        # This method returns a string representation of the player, such as
        # "(name,age,playerValue)"
        return # Remove this line to answer this question

    def __gt__(self, other):
        # This method returns True if the player value of self is greater than 
        # the player value of other. Otherwise, it returns False.
        return # Remove this line to answer this question


0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
python * important *
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Python 3: Write a LinkedList method named contains, that takes a value as a parameter and...

    Python 3: Write a LinkedList method named contains, that takes a value as a parameter and returns True if that value is in the linked list, but returns False otherwise. class Node: """ Represents a node in a linked list """ def __init__(self, data): self.data = data self.next = None class LinkedList: """ A linked list implementation of the List ADT """ def __init__(self): self.head = None def add(self, val): """ Adds a node containing val to the linked list...

  • 9p This is for Python I need help. Pet #pet.py mName mAge class Pet: + __init__(name,...

    9p This is for Python I need help. Pet #pet.py mName mAge class Pet: + __init__(name, age) + getName + getAge0 def init (self, name, age): self.mName = name self.mAge = age Dog Cat def getName(self): return self.mName mSize mColor + __init__(name, age,size) + getSize() + momCommento + getDog Years() +_init__(name, age,color) + getColor + pretty Factor + getCatYears def getAge(self): return self.mAge #dog.py import pet #cat.py import pet class Dog (pet. Pet): class Cat (pet. Pet): def init (self,...

  • I need to complete the code by implementing the min function and the alpha betta pruning...

    I need to complete the code by implementing the min function and the alpha betta pruning in order to complete the tic tac toe game using pything. code: # -*- coding: utf-8 -*- """ Created on: @author: """ import random from collections import namedtuple GameState = namedtuple('GameState', 'to_move, utility, board, moves') infinity = float('inf') game_result = { 1:"Player 1 Wins", -1:"Player 2 Wins", 0:"It is a Tie" } class Game: """To create a game, subclass this class and implement actions,...

  • PYTHON. Continues off another code. I don't understand this. Someone please help! Comment the lines please...

    PYTHON. Continues off another code. I don't understand this. Someone please help! Comment the lines please so I can understand LinkedList ADT: class myLinkedList:     def __init__(self):         self.__head = None         self.__tail = None         self.__size = 0     def insert(self, i, data):         if self.isEmpty():             self.__head = listNode(data)             self.__tail = self.__head         elif i <= 0:             self.__head = listNode(data, self.__head)         elif i >= self.__size:             self.__tail.setNext(listNode(data))             self.__tail = self.__tail.getNext()         else:             current = self.__getIthNode(i - 1)             current.setNext(listNode(data,...

  • 10p Python For the following question, refer to the Python module on the right, as well...

    10p Python For the following question, refer to the Python module on the right, as well as the code below. 1) What is the output of the following code? #dodgeable.py #main dodgeable.py import dodgeable class Locatable: def NUM_CARS = 3 init (self,x,y): NUM TRUCKS = 2 self.mX = X WIDTH = 60 self.mY = y def setx (self,x): def main (): self.mX = x object_list = [] def sety (self, y): self.mY = y for i in range (NUM_CARS) :...

  • PYTHON. Continues off another code(other code is below). I don't understand this. Someone please help! Comment...

    PYTHON. Continues off another code(other code is below). I don't understand this. Someone please help! Comment the lines please so I can understand. There are short and med files lengths for each the list of names/ids and then search id file. These are the input files: https://codeshare.io/aVQd46 https://codeshare.io/5M3XnR https://codeshare.io/2W684E https://codeshare.io/5RJwZ4 LinkedList ADT to store student records(code is below). Using LinkedList ADT instead of the Python List. You will need to use the Student ADT(code is below) Imports the Student class...

  • Please show all work and answer all parts using python, thanks! Instructions You will need to...

    Please show all work and answer all parts using python, thanks! Instructions You will need to create four files: • Shape2D.py - file containing a class definition containing properties all Shapes could possibly have. • Circle.py - file containing a class definition of a Circle that inherits from the Shape2D class. Square.py - file containing a class definition of a Square that inherits from the Shape2D class. • testFile.py - file containing pytest functions testing the Shape2D, Circle, and Square...

  • PYTHON The provided code in the ATM program is incomplete. Complete the run method of the...

    PYTHON The provided code in the ATM program is incomplete. Complete the run method of the ATM class. The program should display a message that the police will be called after a user has had three successive failures. The program should also shut down the bank when this happens. [comment]: <> (The ATM program allows a user an indefinite number of attempts to log in. Fix the program so that it displays a message that the police will be called...

  • Page 3 of 7 (Python) For each substring in the input string t that matches the...

    Page 3 of 7 (Python) For each substring in the input string t that matches the regular expression r, the method call re. aub (r, o, t) substitutes the matching substring with the string a. Wwhat is the output? import re print (re.aub (r"l+\d+ " , "$, "be+345jk3726-45+9xyz")) a. "be$jk3726-455xyz" c. "bejkxyz" 9. b. "be$jks-$$xyz" d. $$$" A object a- A (2) 10. (Python) What is the output? # Source code file: A.py class A init (self, the x): self.x-...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT