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
Which two statements are true about algorithms?
DENIUS [597]

Answer:

I. Algorithms can be written using pseudocode.

II. Algorithms can be visualized using flowcharts.

Explanation:

An algorithm can be defined as a standard formula or procedures which comprises of set of finite steps or instructions for solving a problem on a computer. The time complexity is a measure of the amount of time required by an algorithm to run till its completion of the task with respect to the length of the input.

The two statements which are true about algorithms are;

I. Algorithms can be written using pseudocode. A pseudocode refers to the description of the steps contained in an algorithm using a plain or natural language.

II. Algorithms can be visualized using flowcharts. A flowchart can be defined as a graphical representation of an algorithm for a process or workflow.

Basically, a flowchart make use of standard symbols such as arrows, rectangle, diamond and an oval to graphically represent the steps associated with a system, process or workflow sequentially i.e from the beginning (start) to the end (finish).

3 0
3 years ago
Read 2 more answers
The number of pixels that can be displayed on the screen at one time is known as what? screen resolution. viewing angle. color d
nevsk [136]

Answer:

screen resolution

Explanation:

The screen resolution indicates the number of pixels that can be displayed at one time on a given screen. For example, it could be numbers like 1920x1080, 1600x900 and so on.

Viewing angle has nothing with the pixel count, although viewing port would.  Color depth concerns the number of colors you can display at one time.  Pixel density is the concentration of pixels, like in Apple's retina display, that increases the number of pixels in the screen, but that doesn't give you the information on how many there are.

6 0
3 years ago
Draw a memory map for the following program at the point in the program execution indicated by the comment /*HERE */. In additio
lukranit [14]

Answer:

text   data   bss   dec hex   filename

1857   608   8 2473   9a9   memory-layout

Output of the above Code-

len 3

2

4

200

Explanation:

4 0
3 years ago
What is a sending device? a device on which data, instructions, and information travel a device that accepts the transmission of
DENIUS [597]
<span>What is a sending device? </span>
A sending device is a device that initiates an instruction to transmit data, instructions or information.

8 0
3 years ago
Which protocol is often used to publish web pages to a web server?
zmey [24]
 File Transfer Protocol, also known as FTP
5 0
3 years ago
Other questions:
  • Questions 6 - 9 Refer to the following code: public class WhatsIt { private int[] values; private double average; public WhatsIt
    7·1 answer
  • Match the spreadsheet features with their respective descriptions.
    9·2 answers
  • ________ feature full-time monitoring tools placed at the most vulnerable points, or "hot spots", of corporate networks to prote
    10·1 answer
  • A derived character that is shared by all members of a clade is called a ______________ of that clade.
    6·1 answer
  • Write a function "cashier" that receives an int "c" for the number of items bought. The function will ask the price and task rat
    11·1 answer
  • How do companies use LinkedIn ?
    7·2 answers
  • What are QBASIC Operators ?​
    11·2 answers
  • How do I change my name on my Brainly Profile?
    15·2 answers
  • Emails, Documents, Videos and Audios are examples of- (a) Structured data (b) Unstructured data (c) Semi-structured data (d) Non
    10·1 answer
  • Write an Algorithm to print only numbers from 10 to n times using iteration structure
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!