subject

Write the definition of a class player containing:
an instance variable name of type string, initialized to the empty string.
an instance variable score of type int, initialized to zero. a method called setname that has one parameter, whose value it assigns to the instance variable name.
a method called setscore that has one parameter, whose value it assigns to the instance variable score.
a method called getname that has no parameters and that returns the value of the instance variable name.
a method called getscore that has no parameters and that returns the value of the instance variable score.
no constructor need be defined.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 15:00
What is the total resistance in a circuit that contains three 60 ohm resistors connected in a series? a. 20 ohms b. 120 ohms c. 60 ohms d. 180 ohms
Answers: 2
question
Computers and Technology, 23.06.2019 23:00
How do you know if the website is secure if you make a purchase
Answers: 2
question
Computers and Technology, 24.06.2019 17:40
When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. this can be done by normalizing to values between 0 and 1, or throwing away outliers. for this program, adjust the values by subtracting the smallest value from all the values. the input begins with an integer indicating the number of integers that follow. ex: if the input is 5 30 50 10 70 65, the output is: 20 40 0 60 55
Answers: 1
question
Computers and Technology, 25.06.2019 06:50
Write a program that will askthe user to enter the amount of a purchase. the program should thencompute the state and county sales tax. assume the state sales tax is4 percent and the county sales tax is 2 percent. the program should displaythe amount of the purchase, the state tax, the county sales tax, the total salestax, and the total of the sale. (which is the sum of theamount of purchase plus the total sales tax). hint: use the value 0.02 torepresent 2 percent, and 0.04 to represent 4 percent.
Answers: 2
You know the right answer?
Write the definition of a class player containing:
an instance variable name of type string,...
Questions
question
Mathematics, 21.09.2020 03:01
Questions on the website: 13722361