subject
Computers and Technology, 16.10.2020 04:01 leo4687

Define a class for a soccer (football) player. Each player has the following properties or characteristics:
a name (a String)
a team (a String)
number of games played (an integer)
total number of goals scored (an integer)
Provide the following functionality:
a constructor (given name and team, start the others at zero)
a toString method accessors for each property
a method to compute and return the average goals per game
a mutator method, given the number of goals scored in one game, update the number of games and the goals scored
a mutator method, to set the team to the given team.
Also define a class to test this one containing a main program that does the following:
instantiate a player for Cristiano Ronaldo with Real Madrid.
output all the information on Ronaldo (from the instance).
update Ronaldo's information for one game scoring 3 goals.
update Ronaldo's information for one game scoring 1 goal.
output the average goals per game for Ronaldo.
output just Ronaldo's team (from the instance).
change Ronaldo's team to Juventus.
output all the information on Ronaldo (from the instance).
Notice that there is no input from the user. This does not have to be compiled and tested.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
Create a word problem that involves calculating the volume and surface area of a three-dimensional object. cube: surface area 6 s2 , volume s3
Answers: 3
question
Computers and Technology, 22.06.2019 12:00
The following function returns a string of length n whose characters are all 'x'. give the order of growth (as a function of n) of the running time. recall that concatenating two strings in java takes time proportional to the sum of their lengths. public static string f(int n) { if (n == 0) return ""; if (n == 1) return "x"; return f(n/2) + f(n - n/2); } options: a) constant b) logarithmic c) linear d) linearithmic e)quadratic f)cubic g) exponential
Answers: 2
question
Computers and Technology, 22.06.2019 17:00
What allows you to create a wireless connection among your smart devices
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Pl i need the answer now ! which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
You know the right answer?
Define a class for a soccer (football) player. Each player has the following properties or characte...
Questions
question
Computers and Technology, 10.11.2019 08:31
question
Mathematics, 10.11.2019 08:31
Questions on the website: 13722361