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
Calculate the osmotic pressure of seawater containing 3.5 wt % NaCl at 25 °C . If reverse osmosis is applied to treat seawater,
AlladinOne [14]

Answer:

Highest osmotic pressure that membrane may experience is

' =58.638 atm

Explanation:

Suppose sea-water taken is M= 1 kg

Density of water = 1000 kg/m3

Therefore Volume of water= Mass,M/Density of water

V= 1 kg/(1000 kg/m3)

V= 10-3 m3= 1 Litre

Since mass of Nacl is 3.5 wt%,Therefore in 1 kg of water

Mass present of NaCl= m= 0.035*1000 g

m= 35 g

Since molecular weight of NaCl= 58.44 g/mol =M.W.

Thus its Number of moles of Nacl= m/M.W

nNaCl= 35g/58.44 gmol-1

= 0.5989 mol

ans since volume of solution is 1 L thus concentration of NaCl is ,C= number of moles/Volume of solution in Litres

C= 0.5989mol/ 1L

=0.5989 M

Since 1 mol NaCL disssociates to form 2 moles of ions of Na+ andCl- Thus van't hoff factor i=2

And osmotic pressure  = iCRT ------------------------------(1)( Where R= 0.0821 L.atm/mol.K and T= 25oC= 298.15 K)

Putting in equation 1 ,we get  = 2*(0.5989 mol/L)*(0.0821 L.atm/mol.K)*298.15 K

=29.319 atm

Now as the water gets filtered out of the membrane,the water's volume decreases and concentration C of NacL increases, thus osmotic pressure also increases.Thus, at 50% water been already filtered out, the osmotic pressure at the membrane will be maximum

Thus Volume of water left after 50% is filtered out as fresh water= 0.5 L (assuming no salt passes through semi permeable membrane)

Thus New concentration of NaCl C'= 2*C

C'=2*0.5989 M

=1.1978 M

and Since Osmotic pressure is directly proportional to concentration, Thus As concentration C doubles to C', Osmotic Pressure  ' also doubles from  ,

Thus,Highest osmotic pressure that membrane may experience is,  '=2*  

=2*29.319 atm

' =58.638 atm

3 0
3 years ago
How do you keep the weight evenly distributed on a trailered boat?
Neporo4naja [7]
C because i know what i’m taking about
7 0
3 years ago
In DC electrode positive, how much power is at the work clamp?
Korolek [52]

Answer:

1/3 power

Explanation:

I'm just a smart guy

7 0
3 years ago
I have a molten Ni-Cu alloy with 60 wt%Ni. (ii) I cool it down to a temperature where I have both solid and liquid phases. At th
SIZIF [17.4K]

Answer:

The percentage of the remaining alloy would become solid is 20%

Explanation:

Melting point of Cu = 1085°C

Melting point of Ni = 1455°C

At 1200°C, there is a 30% liquid and 70% solid, the weight percentage of Ni in alloy is the same that percentage of solid, then, that weight percentage is 70%.

The Ni-Cu alloy with 60% Ni and 40% Cu, and if we have the temperature of alloy > temperature of Ni > temperature of Cu, we have the follow:

60% Ni (liquid) and 40% Cu (liquid) at temperature of alloy

At solid phase with a temperature of alloy and 50% solid Cu and 50% liquid Ni, we have the follow:

40% Cu + 10% Ni in liquid phase and 50% of Ni is in solid phase.

The percentage of remaining alloy in solid is equal to

Solid = (10/50) * 100 = 20%

4 0
3 years ago
Water is the working fluid in an ideal Rankine cycle. The condenser pressure is 8 kPa, and saturated vapor enters the turbine at
sergeinik [125]

Explanation:

The obtained data from water properties tables are:

Point 1 (condenser exit) @ 8 KPa, saturated fluid

h_{f} = 173.358 \\h_{fg} = 2402.522

Point 2 (Pump exit) @ 18 MPa, saturated fluid & @ 4 MPa, saturated fluid

h_{2a} =  489.752\\h_{2b} =  313.2

Point 3 (Boiler exit) @ 18 MPa, saturated steam & @ 4 MPa, saturated steam

h_{3a} = 2701.26 \\s_{3a} = 7.1656\\h_{3b} = 2634.14\\s_{3b} = 7.6876

Point 4 (Turbine exit) @ 8 KPa, mixed fluid

x_{a} = 0.8608\\h_{4a} = 2241.448938\\x_{b} = 0.9291\\h_{4b} = 2405.54119

Calculate mass flow rates

Part a) @ 18 MPa

mass flow

\frac{100*10^6 }{w_{T} - w_{P}} = \frac{100*10^3 }{(h_{3a}  - h_{4a}) - (h_{2a}  - h_{f})}\\\\= \frac{100*10^ 3}{(2701.26  - 2241.448938 ) - (489.752  - 173.358)}\\\\= 697.2671076 \frac{kg}{s} = 2510161.587 \frac{kg}{hr}

Heat transfer rate through boiler

Q_{in}  = mass flow * (h_{3a} -  h_{2a})\\Q_{in} = (697.2671076)*(2701.26-489.752)\\\\Q_{in} = 1542011.787 W

Heat transfer rate through condenser

Q_{out}  = mass flow * (h_{4a} -  h_{f})\\Q_{out} = (697.2671076)*(2241.448938-173.358)\\\\Q_{out} = 1442011.787 W

Thermal Efficiency

n = \frac{W_{net}  }{Q_{in} } = \frac{100*10^3}{1542011.787}  \\\\n = 0.06485

Part b) @ 4 MPa

mass flow

\frac{100*10^6 }{w_{T} - w_{P}} = \frac{100*10^3 }{(h_{3b}  - h_{4b}) - (h_{2b}  - h_{f})}\\\\= \frac{100*10^ 3}{(2634.14  - 2405.54119 ) - (313.12  - 173.358)}\\\\= 1125 \frac{kg}{s} = 4052374.235 \frac{kg}{hr}

Heat transfer rate through boiler

Q_{in}  = mass flow * (h_{3b} -  h_{2b})\\Q_{in} = (1125.65951)*(2634.14-313.12)\\\\Q_{in} = 2612678.236 W

Heat transfer rate through condenser

Q_{out}  = mass flow * (h_{4b} -  h_{f})\\Q_{out} = (1125)*(2405.54119-173.358)\\\\Q_{out} = 2511206.089 W

Thermal Efficiency

n = \frac{W_{net}  }{Q_{in} } = \frac{100*10^3}{1542011.787}  \\\\n = 0.038275

6 0
3 years ago
Other questions:
  • When the outside temperature is 5.2 ⁰C, a steel beam of cross-sectional area 52 cm2 is installed in a building with the ends of
    8·1 answer
  • Answer this question fast
    8·1 answer
  • What is the composition, in atom percent, of an alloy that consists of 4.5 wt% Pb and 95.5 wt% Sn?
    13·1 answer
  • 1 kg of saturated steam at 1000 kPa is in a piston-cylinder and the massless cylinder is held in place by pins. The pins are rem
    5·1 answer
  • A geothermal heat pump absorbs 15 KJ/s of heat from the Earth 15 m below a house. This heat pump uses a 7.45 kJ/s compressor.
    5·2 answers
  • This elementary problem begins to explore propagation delayand transmission delay, two central concepts in data networking. Cons
    6·1 answer
  • What is wrong with the following code?<br> 6<br> print (what is your name?)
    9·2 answers
  • Contrast the electron and hole drift velocities through a 10 um (micro meter) layer of intrinsic silicon across which a voltage
    11·1 answer
  • Using your knowledge of how an ATM is used, develop a set of use cases that could serve as a basis for understanding the require
    15·1 answer
  • I need your help to answer in the picture plss help me!​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!