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
When should the sponsor-monitor conduct the most detailed review of the study protocol with the site's study staff?
Likurg_2 [28]

Answer:

Site initiation visit is the correct answer.

Explanation:

Because the SIV is the sponsor-monitor which administers the detailed analysis of the site's study staff by the study protocol and it observes the process of the visite over a while that it take place after the visite of the site section. It also needed to set up the research site to administrates the analysis. So, that's why the following answer is true.

8 0
3 years ago
Which of the following is not a characteristic of data that can strongly affect cluster analysis?
german

Answer:

c. Skewness

Explanation:

Cluster analysis involves analyzing a set of object by grouping the set of objects in such a way that objects in the one group or cluster are more similar  to each other than to those in other groups or clusters. The characteristics of data that can strongly affect cluster analysis includes the size, sparseness, scale, etc.

3 0
3 years ago
Which device performs the function of determining the path that messages should take through internetworks?.
bija089 [108]

Answer:

A router

Explanation:

8 0
2 years ago
You have a unique id number, which is represented by the variable id, containing a string of numbers. write a program that conti
koban [17]

idNumber = "123456"
idNo = input("Enter the unique ID number: ")
while idNumber != idNo:
print("This is not your ID number.")
idNo = input("Enter the unique ID number: ")
print("This is your ID number: ", idNo)

Output:

sh-4.3$ python3 main.py                                                                                                                                                                                                                                                

Enter the unique ID number: 2345                                                                                                                                                                                                                                       

This is not your ID number.                                                                                                                                                                                                                                            

Enter the unique ID number: 4563                                                                                                                                                                                                                                       

This is not your ID number.                                                                                                                                                                                                                                            

Enter the unique ID number: 12345                                                                                                                                                                                                                                      

This is not your ID number.                                                                                                                                                                                                                                            

Enter the unique ID number: 123456                                                                                                                                                                                                                                     

This is your ID number:  123456

8 0
3 years ago
Read 2 more answers
Which of the following statements are true regarding models? Select 3 options.
IrinaVladis [17]

Answer:

Models represent the system or problem at a detailed implementation level.

Models help communicate a design.

Models help you understand a complex situation by including all of the details.

hope this is correct :)

6 0
2 years ago
Other questions:
  • 2. In many jurisdictions a small deposit is added to containers to encourage people to recycle them. In one particular jurisdict
    7·1 answer
  • A negative effect of computer technology's role in creating images is that:
    13·2 answers
  • What are the differences between packet and circuit switching? Which is more prevalent today?
    10·1 answer
  • What is IaaS? For this service model, what are the resources the cloud vendor will provide/manage and what are the resources the
    15·1 answer
  • In describing a new problem you are having with your computer, your boss interrupts and states, I had the same problem last week
    10·2 answers
  • NEED FIVE QUESTIONS ANSWERED!!!
    7·1 answer
  • Imagine you are a toy designer. How would you use measuring, dimensions, volume, and surface area information to create your toy
    10·2 answers
  • Public class Main{ public static void main(String [] args){ String name=WelcomeJava; Runnable r1=() -> System.out.println(nam
    12·1 answer
  • All of the following are true about data science and big data except: a.Digital data is growing at the rate of 2.5 quintillion b
    15·1 answer
  • Identify and explain 4 traditional (old ways) marketing approaches used by University uses in reaching
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!