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
barxatty [35]
3 years ago
11

Write the implementation (.cpp file) of the Player class from the previous exercise. Again, the class contains:

Engineering
1 answer:
hoa [83]3 years ago
7 0

Answer:

//Define the header file

#ifndef PLAYER_H

#define PLAYER_H

//header file.

#include <string>

//Use the standard namespace.

using namespace std;

//Define the class Player.

class Player

{

//Declare the required data members.

string name;

int score;

public:

//Declare the required

//member functions.

void setName(string par_name);

void setScore(int par_score);

string getName();

int getScore();    

}

//End the definition

//of the header file.

#endif

Player.cpp:

//Include the "Player.h" header file,

#include "Player.h"

//Define the setName() function.

void Player::setName(string par_name)

{

name = par_name;

}

//Define the setScore() function.

void Player::setScore(int par_score)

{

score = par_score;

}

//Define the getName() function.

string Player::getName()

{

return name;

}

//Define the getScore() function.

int Player::getScore()

{

return score;

}

You might be interested in
The critical resolved shear stress for iron is 27 MPa (4000 psi). Determine the maximum possible yield strength for a single cry
jasenka [17]

Answer:

Answer is mentioned below.

Explanation:

Answer: Calculation of maximum yield strength for a single crystal of Fe pulled in tension is shown in the image attached .

value of max. Yield strength= 54MPa

7 0
4 years ago
Discuss the trends in reaction forces versus jet velocity. Is the trend consistent with the theory? Does it make sense?
Snowcat [4.5K]

Answer:

The rate of fluid motion(Jet Velocity) exert a force on the object in contact with it. This force is also knowns as reactions forces.

In theory, this is related to Newton Second of motion which States that:

The rate of change of momentum is directly proportional to impressed force.

This makes sense and it is consistent with theory. Detailed explanation below:

Explanation:

A jet which can be illustrated as a moving fluid, in natural or artificial systems, may exert forces on objects in contact with it.

To analyze fluid motion, a finite region of the fluid (control volume) is usually selected, and the gross effects of the flow, such as its force or torque on an object, is determined by calculating the net mass rate that flows into and out of the control volume.

These forces can be determined, as in solid mechanics, by the use of Newton’s second law, or by the momentum equation(Consistent with the theory). The force exerted by a jet of fluid on a flat or curve surface can be resolved by applying the momentum equation. The study of these forces is essential to the study of fluid mechanics and hydraulic machinery.

In practice, Engineers and designers use the momentum equation to accurately calculate the force that moving fluid may exert on a solid body. For example, in hydropower plants, turbines are utilized to generate electricity. Turbines rotate due to force exerted by one or more water jets that are directed tangentially onto the turbine’s vanes or buckets. The impact of the water on the vanes generates a torque on the wheel, causing it to rotate and to generate electricity.

3 0
4 years ago
Malia is working with aluminum wire. while working with this type of wire, she must remember to a. always use pressure-type term
Y_Kistochka [10]

Answer:

B

Explanation:

Aluminium doesn't rust unless exposed to copper for a duration of time.

4 0
3 years ago
The Leaning Tower of Pisa is located in which country? Question 1 options: France Italy The United States Norway
Ket [755]

Answer:

Tuscany, Central Italy

Explanation:

5 0
3 years ago
Read 2 more answers
A pin must be inserted into a collar of the same steel using an expansion fit. The coefficient of thermal expansion of the metal
nirvana33 [79]

Answer:

a)  the temperature to which the pin must be cooled for assembly is T_2 = -101.89^ \ ^0}C

b) the radial pressure at room temperature after assembly is P_f = 62.8 \ MPa

c) the  safety factor in the resulting assembly = 6.4

Explanation:

Coefficient of thermal expansion \alpha = 12.3*10^{-6} \  ^0 C

Yield strength \sigma_y = 400 MPa

Modulus of elasticity (E) = 209 GPa

Room Temperature T_1 = 20°C

outer diameter of the collar D_o = 95 \ mm

inner diameter of the collarD_i = 60 \ mm

pin diameter D_p = 60.03 \ mm

Clearance c = 0.06 mm

a)

The temperature to which the pin must be cooled for assembly can be calculated by using the formula:

(D_i - c )-D_p = \alpha * D_p(T_2-T_1)

(60-0.06)-60.03=12.3*10^{-6}*60.03(T_{2}-20^{0}C)

-0.09 = 7.38369*10^{-4}(T_{2}-20^{0}C)

-0.09 = 7.38369*10^{-4}T_2  \ \ - \ \ 0.01476738

-0.09 +  0.01476738 = 7.38369*10^{-4}T_2

−0.07523262 =7.38369*10^{-4}T_2

T_2 = \frac{-0.07523262}{7.38369*10^{-4}}

T_2 = -101.89^ \ ^0}C

b)

To determine the radial pressure at room temperature after assembly ;we have:

P_f = \frac{E * (D_p-D_i)(D_o^2-D_1^2)}{D_i*D_o} \\ \\ \\  P_f = \frac{209*10^9* 0.03(95^2-60^2)}{60*95^2}  \\ \\ P_f = 62815789.47 \ Pa \\ \\ P_f = 62.8 \ MPa

c)  the safety factor of the resulting assembly is calculated as:

safety factor =  \frac{Yield \ strength }{walking \ stress}

safety factor =  \frac{400}{62.8}

safety factor = 6.4

Thus, the  safety factor in the resulting assembly = 6.4

4 0
3 years ago
Other questions:
  • A rectangular channel 6 m wide with a depth of flow of 3m has a mean velocity of 1.5 m/sec. The channel undergoes a smooth, grad
    7·1 answer
  • Ammonia gas is diffusing at a constant rate through a layer of stagnant air 1 mm thick. Conditions are such that the gas contain
    14·1 answer
  • In a hydroelectric power plant, water enters the turbine nozzles at 780 kPa absolute with a low velocity. If the nozzle outlets
    11·1 answer
  • Crawling in heavy smoke or extreme heat can increase
    6·1 answer
  • A manometer connected to a Pitot-static tube has a difference in the height of the two columns of water of 10 cm when the Pitot-
    7·1 answer
  • The substance called olivine may have any composition between Mg2SiO4 and Fe2SiO4, i.e. the Mg atoms can be replaced by Fe atoms
    10·1 answer
  • You are an electrician on the job. The electrical blueprint shows that eight 500-W lamps are to be installed on the same circuit
    11·1 answer
  • A(n) ____ is an object setting used to control the visible display of objects.
    15·1 answer
  • A clean machine is a _______________ machine.
    11·1 answer
  • When working cattle through a chute, stop cattle by moving…point of balance.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!