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
The batteries on electric vehicles are recharged using electricity from either a wall socket or dedicated charging unit.
yuradex [85]

Answer:

true

Explanation:

7 0
2 years ago
On early computers, every byte of data read or written was handled by the CPU (i.e., there was no DMA). What implications does t
grandymaker [24]

Answer:

Multiprogramming will be extremely difficult to be achieved.

Explanation:

If every byte of data read or written is handled by the CPU the implications this will have for multiprogramming are not going to be satisfactory.

This is because, unlike before, after the successful completion of the input and output process, the CPU of a computer is not entirely free to work on other instructions or processes.

5 0
3 years ago
What does "CPU" stand for?
sergiy2304 [10]
Central Processing Unit
8 0
3 years ago
Read 2 more answers
Keep a log of the different types of communication activities in which you engage during the rest of the day. Categorize each ac
baherus [9]

There are 4 different types of communication and I can share my experience by helping you out to solve the assignment.

Explanation:

1. Verbal Communication:

  • Communication with voice
  • Provides active listening
  • Body language is equally important.

2. Non-Verbal:

  • Body language is the most important
  • Communicating without using the words

3. Visual communication:

  • Listening contents through photos and videos

4. Written communication:

  • Serves as record
  • Does not require tone

So in day today aspect we come across almost all type of communication. To answer the discussed question

1. Did the variety of communication surprised you?

I would say yes. I can say unknowingly I have experienced various types.

2. Did you find that your were more involved in one type of communication?

I would say yes. People may like communication type depending on their interest and skill set. So according to me even I have involved in my life with one set of communication and I am trying to use it more.

3. Which one(s) is/are most involved?

So it differs from people to people. I like verbal communication, because I am good at speaking with good tone and voice. Also, I am attracted towards visual communication because one picture will talk more than what an essay would communicate.

6 0
3 years ago
Any song recommendations, pls dont say 6ix9ine or lil pump
gogolik [260]

I actually do have one tho. Try Megan Tha Stallion.

8 0
3 years ago
Read 2 more answers
Other questions:
  • How did mechanical clocks assist in completing work? How was work done previously?
    12·1 answer
  • GUI allows users to communicate with a device and see what they are doing onscreen.
    9·1 answer
  • Who developed the idea of a universal network?
    11·1 answer
  • Multiple arrays. Jump to level 1 For any element in keysList with a value greater than 40, print the corresponding value in item
    7·2 answers
  • Which result is most likely if a network packet has no header?
    9·2 answers
  • Special words are those words that start and end with the same letter. [14]
    12·1 answer
  • Importance of type casting in programming ​
    5·1 answer
  • Match the following
    13·1 answer
  • Explain ONE negative outcomes of not matching an ICT product to the correct audience:
    15·1 answer
  • Basil was reading about a new attack that forces the system to abandon a higher cryptographic security mode of operation and ins
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!