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, 21.06.2019 20:20
Sometimes writers elaborate on the truth when recalling past events so they can enhance their narrative essay with more interesting descriptions. do you feel that published writers should or should not embellish real life events just to make their stories more interesting?
Answers: 2
question
Computers and Technology, 22.06.2019 05:30
Gerard is currently working as an entry-level customer support technician, but he would like to someday become a software developer. what is the best first step to understand what he should do? ask his manager for a new job or at least a job recommendation study graphic design in order to obtain the necessary skills use career resources to investigate what skills and education are required work part-time as an entry-level web developer question 13 (true/false worth 6 points) (08.03 lc) career resources are used to explore career options and find career information. true false question 14(multiple choice worth 6 points) (08.01 mc) classify the following skills: writing html code, evaluating color theory, using design principles. hard skills interpersonal skills people skills soft skills question 15 (true/false worth 6 points) (08.03 lc) a mentor is a person who is advised, trained, or counseled by a trusted mentee. true false
Answers: 2
question
Computers and Technology, 22.06.2019 10:20
Shown below is the start of a coding region within the fist exon of a gene. 5'--3' 3'--5' how many cas9 pam sequences are present?
Answers: 1
question
Computers and Technology, 23.06.2019 00:40
Consider the following statements: struct nametype{string first; string last; }; struct coursetype{string name; int callnum; int credits; char grade; }; struct studenttype{nametype name; double gpa; coursetype course; }; studenttype student; studenttype classlist[100]; coursetype course; nametype name; mark the following statements as valid or invalid. if a statement is invalid, explain why.a.) student.course.callnum = "csc230"; b.) cin > > student.name; c.) classlist[0] = name; d.) classlist[1].gpa = 3.45; e.) name = classlist[15].name; f.) student.name = name; g.) cout < < classlist[10] < < endl; h.) for (int j = 0; j < 100; j++)classlist[j].name = name; i.) classlist.course.credits = 3; j.) course = studenttype.course;
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
Advanced Placement (AP), 07.07.2019 04:00
Questions on the website: 13722360