Question: ( (25 p) Write the class that will fulfill the following conditions a) (5 points) Create a class named FutbolTakimi that will represent a football
-
( (25 p) Write the class that will fulfill the following conditions a) (5 points) Create a class named FutbolTakimi that will represent a football team under a package named football. Define the FootballTeam class so that it can be accessed from any package. b) (4 points) Define the following properties in such a way that they are not allowed to be accessed from outside the class. Name of the team; Number of wins, Number of losses c) (4 points) Write a constructor method that accepts the team's name, number of wins, and number of losses as parameters and sets the class properties to these values. This constructor method must be accessible from any package. d) (4 points) Write a second constructor method that takes the name of the team only as a parameter. This constructor method should set the number of wins and losses to 0, according to the parameter from which the team is named. (Hint: This constructor must have one line of code in its body and call the first constructor method.) This constructor must be accessible from any package. e) (4 points) Write down the name of the team, the number of wins and the methods to return the number of losses. These methods should be accessible from any package. f) (4 points) Write one method to increase the number of wins by 1 and another method to increase the number of losses by one. These methods should only be accessible from within the soccer package. Call the method and print the result).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
