1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
tresset_1 [31]
3 years ago
7

Write the interface (.h file) of a class Player containing: A data member name of type string. A data member score of type int.A

member function called setName that accepts a parameter and assigns it to name . The function returns no value.
A member function called setScore that accepts a parameter and assigns it to score . The function returns no value.
A member function called getName that accepts no parameters and returns the value of name .
A member function called getScore that accepts no parameters and returns the value of score .
My start code:
class Player
{
string name;
int score;
void setScore (int playerScore)
{
score = playerScore;
}
int getScore()
{
return score;
}
}
Computers and Technology
1 answer:
mezya [45]3 years ago
7 0

Answer:

Following are the class definition to this question:

class Player//defining a Player class  

{

private://use access specifier

string name;//defining string variable  

int score;//defining integer variabl  

public://use access specifier

void setName(string par_name);//declaring the setName method with one string parameter

void setScore(int par_score);//declaring the setScore method with one integer parameter

string getName();//declaring string method getName

int getScore();//declaring integer method getScore

};

Explanation:

In the above-given code, a Player class is defined, that hold a method and the variable which can be defined as follows:

  • It uses two access specifier, that are public and private.
  • In private, a string and an integer variable "name, score" is declared, which holds their respective value.
  • In public, it declares the get and set method, which holds the value from its parameters.
You might be interested in
Es el conjunto de manifestaciones materiales, intelectuales y espirituales que distinguen a un pueblo a)Civilización b)Cultura c
GREYUIT [131]

Answer:

a)Civilización

Explanation:

3 0
3 years ago
What is the default method of referencing cells in formulas?
ELEN [110]
In Microsoft Excel, cell referencing is the method by which you refer to a cell or series of cells in a formula. Cell referencing is not important unless you plan to copy the formula to a number of other cells. In Excel, cell referencing is relative by default
7 0
3 years ago
Which of these is a benefit of using the Sort option?​
Reika [66]

There are many benefits of using the shot options in Excel. Some benefits are allowing you to short by number,date,color, letter, columns,or text. This benefits the user because it allows the user to bring data up more easily.

I hope this answers is helpful

3 0
3 years ago
After a security incident is verified in a SOC, an incident responder reviews the incident but cannot identify the source of the
oksian1 [2.3K]

Answer:

Option A i.e., SME for further investigation.

Explanation:

Following the reports of such a security incident into an SOC, an incident respondent examines the incident but could not determine the cause of that same incident as well as establish an appropriate response protocol. The ticket for an incident must be applied to SME for even more inquiry. So, the following answer is correct.

5 0
3 years ago
Photographing during the midday can produce which of the following?
deff fn [24]
It can produce harsh shadows
5 0
3 years ago
Read 2 more answers
Other questions:
  • Disk scheduling algorithms in operating systems consider only seek distances, because Select one: a. modern disks do not disclos
    13·1 answer
  • A digital footprint is all of the information on-line about a person posted by that person or others, ____________. intentionall
    14·1 answer
  • The essence of strategy is ____, so competitive advantage is often gained when an organization tries a strategy that no one has
    15·1 answer
  • A film camera with only one lens is known as a(n)?
    11·1 answer
  • Help me out with this .....
    10·1 answer
  • When the Squirrel peer-to-peer web caching service was evaluated by simulation, 4.11 hops were required on average to route a re
    11·1 answer
  • Draw a dfd that shows how data will be stored, processed, and transformed in the tims system
    9·1 answer
  • 20 points for ez question lol
    9·2 answers
  • Do pc players ever go outside?
    11·2 answers
  • A social service agency hires accenture to improve training and experiences for caseworkers. What is one way accenture can use v
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!