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
What is the formula for measuring the speed of an object
STALIN [3.7K]
S= d/t
Speed= distance/time
8 0
3 years ago
What should be given to a customer before doing a repair?
natima [27]
A. I believe, lmk if I’m right
7 0
3 years ago
For some transformation having kinetics that obey the Avrami equation (Equation 10.17), the parameter n is known to have a value
OleMash [197]

Answer:

t = 25.10 sec

Explanation:

we know that Avrami equation

Y = 1 - e^{-kt^n}

here Y is percentage of completion  of reaction = 50%

t  is duration of reaction = 146 sec

so,

0.50 = 1 - e^{-k^146^2.1}

0.50 = e^{-k306.6}

taking natural log on both side

ln(0.5) = -k(306.6)

k = 2.26\times 10^{-3}

for 86 % completion

0.86 = 1 - e^{-2.26\times 10^{-3} \times t^{2.1}}

e^{-2.26\times 10^{-3} \times t^{2.1}} = 0.14

-2.26\times 10^{-3} \times t^{2.1} = ln(0.14)

t^{2.1} = 869.96

t = 25.10 sec

5 0
3 years ago
Ti-6Al-4V has a fracture toughness of 74.6 MPa-m0.5. How much stress (in MPa) would it take to fail a plate loaded in tension th
Nikitich [7]

Answer:

critical stress  = 595 MPa

Explanation:

given data

fracture toughness =  74.6 MPa-\sqrt{m}

crack length = 10 mm

f = 1

solution

we know crack length = 10 mm  

and crack length = 2a as given in figure attach

so 2a = 10

a = 5 mm

and now we get here with the help of plane strain condition , critical stress is express as

critical stress  = \frac{k}{f\sqrt{\pi a}}    ......................1

put here value and we get

critical stress  = \frac{74.6}{1\sqrt{\pi 5\times 10^{-3}}}

critical stress  = 595 MPa

so here stress is change by plane strain condition because when plate become thinner than condition change by plane strain to plain stress.

plain stress condition occur in thin body where stress through thickness not vary by the thinner section.

6 0
3 years ago
A 4-L pressure cooker has an operating pressure of 175 kPa. Initially, one-half of the volume is filled with liquid and the othe
vodomira [7]

Answer:

the highest rate of heat transfer allowed is 0.9306 kW

Explanation:

Given the data in the question;

Volume = 4L = 0.004 m³

V_f = V_g = 0.002 m³

Using Table ( saturated water - pressure table);

at pressure p = 175 kPa;

v_f = 0.001057 m³/kg

v_g = 1.0037 m³/kg

u_f = 486.82 kJ/kg

u_g 2524.5 kJ/kg

h_g = 2700.2 kJ/kg

So the initial mass of the water;

m₁ = V_f/v_f + V_g/v_g

we substitute

m₁ = 0.002/0.001057  + 0.002/1.0037

m₁ = 1.89414 kg

Now, the final mass will be;

m₂ = V/v_g

m₂ = 0.004 / 1.0037

m₂ = 0.003985 kg

Now, mass leaving the pressure cooker is;

m_{out = m₁ - m₂

m_{out = 1.89414  - 0.003985

m_{out = 1.890155 kg

so, Initial internal energy will be;

U₁ = m_fu_f + m_gu_g

U₁ = (V_f/v_f)u_f  + (V_g/v_g)u_g

we substitute

U₁ = (0.002/0.001057)(486.82)  + (0.002/1.0037)(2524.5)

U₁ = 921.135288 + 5.030387

U₁ = 926.165675 kJ

Now, using Energy balance;

E_{in -  E_{out = ΔE_{sys

QΔt - m_{outh_{out = m₂u₂ - U₁

QΔt - m_{outh_g = m₂u_g - U₁

given that time = 75 min = 75 × 60s = 4500 sec

so we substitute

Q(4500) - ( 1.890155 × 2700.2 ) = ( 0.003985 × 2524.5 ) - 926.165675

Q(4500) - 5103.7965 = 10.06013 - 926.165675

Q(4500) = 10.06013 - 926.165675 + 5103.7965

Q(4500) = 4187.690955

Q = 4187.690955 / 4500

Q = 0.9306 kW

Therefore, the highest rate of heat transfer allowed is 0.9306 kW

5 0
3 years ago
Other questions:
  • An equal-tangent sag vertical curve connects a 1% and 3% initial and final grades, respectively, and is designed for 70 mph. The
    12·1 answer
  • g A food department is kept at -12oC by a refrigerator in an environment at 30oC. The total heat gain to the food department is
    7·1 answer
  • Explain why the following acts lead to hazardous safety conditions when working with electrical equipmentA) Wearing metal ring o
    11·1 answer
  • Heat is applied to a rigid tank containing water initially at 200C, with a quality of 0.25, until the pressure reaches 8 MPa. De
    8·1 answer
  • An air standard cycle with constant specific heats is executed in a closed system with 0.003 kg of air and consists of the follo
    15·1 answer
  • A common chef's knife is single-beveled.<br> TRUE<br> FALSE
    10·1 answer
  • All welding processes that take place without melting of the work pieces. a)- True b)-False
    15·1 answer
  • Before taking off a plane travels at a speed of 1/4 km per second. The runaway is 5 km. How many seconds does it take the plane
    9·1 answer
  • Please help with my economics problem
    8·1 answer
  • Most equipment is cooled by bringing cold air in the front and ducting the heat out of the back. What is the term for where the
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!