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
Sliva [168]
3 years ago
7

Write a class named FBoard for playing a game, where player x is trying to get her piece to row 7 and player o is trying to make

it so player x doesn't have any legal moves. It should have: An 8x8 array of char for tracking the positions of the pieces.A data member called gameState that holds one of the following values: X_WON, O_WON, or UNFINISHED - use an enum type for this, not string (the enum definition should go in Board.hpp, before the class, not inside it).Data members to keep track of where the x piece is.A default constructor that initializes the array to empty (you can use whatever character you want to represent empty). It should then put four o pieces on row 7, in columns 0, 2, 4, and 6. It should put an x piece on row 0, column 3. It should also initialize the other data members.A method called getGameState that just returns the value of gameState.A method called moveX that takes as parameters the row and column of the square to move to. If the desired move is not allowed, or if the game has already been won, it should just return false. Otherwise it should make the move and return true. A piece belonging to x can move 1 square diagonally in any direction. A piece is not allowed to move off the board or to an occupied square. If x's move gets her piece to row 7, gameState should be set to X_WON.A method called moveO that takes as parameters the row and column to move from, and the row and column to move to. If the first pair of coordinates doesn't hold o's piece, or if the desired move is not allowed, or if the game has already been won, it should just return false. Othewise it should make the move and return true. A piece belonging to o can move 1 square diagonally, but the row cannot increase, so any o piece has at most two available moves. For example, if player o has a piece at (5, 2), it could move to (4, 1) or (4, 3), but not (6, 1) or (6, 3). It is not allowed to move off the board or to an occupied square. If o's move leaves no legal move for x, gameState should be set to O_WON.You do not need to track whose turn it is. Either move method can be called multiple times in a row. It doesn't matter which index of the array you consider the row and which you consider the column as long as you're consistent.Feel free to add private helper functions if you want. You may also find it useful to add a public print function to help with debugging.Do not access the array out of bounds. Make sure values are in bounds before using them to index into the array.
Engineering
1 answer:
OverLord2011 [107]3 years ago
7 0

Answer:

12345=V

Explanation:

You might be interested in
In a creep test, increasing the temperature will (choose the best answer) A. increase the instantaneous initial deformation B. i
Hitman42 [59]

Answer:

All of the above

Explanation:

firstly, a creep can be explained as the gradual deformation of a material over a time period. This occurs at a fixed load with the temperature the same or more than the recrystallization temperature.

Once the material gets loaded, the instantaneous creep would start off and it is close to electric strain. in the primary creep area, the rate of the strain falls as the material hardens. in the secondary area, a balance between the hardening and recrystallization occurs. The material would get to be fractured hen recrstallization happens.  As temperature is raised the recrystallization gets to be more.

8 0
2 years ago
A Rankine steam power plant is considered. Saturated water vapor enters a turbine at 8 MPa and exits at condenser at 10 kPa. The
Ray Of Light [21]

Answer:

0.31

126.23 kg/s

Explanation:

Given:-

- Fluid: Water

- Turbine: P3 = 8MPa , P4 = 10 KPa , nt = 85%

- Pump: Isentropic

- Net cycle-work output, Wnet = 100 MW

Find:-

- The thermal efficiency of the cycle

- The mass flow rate of steam

Solution:-

- The best way to deal with questions related to power cycles is to determine the process and write down the requisite properties of the fluid at each state.

First process: Isentropic compression by pump

       P1 = P4 = 10 KPa ( condenser and pump inlet is usually equal )

      h1 = h-P1 = 191.81 KJ/kg ( saturated liquid assumption )

       s1 = s-P1 = 0.6492 KJ/kg.K

       v1 = v-P1 = 0.001010 m^3 / kg

       

       P2 = P3 = 8 MPa( Boiler pressure - Turbine inlet )

       s2 = s1 = 0.6492 KJ/kg.K   .... ( compressed liquid )

- To determine the ( h2 ) at state point 2 : Pump exit. We need to determine the wok-done by pump on the water ( Wp ). So from work-done principle we have:

   

                           w_p = v_1*( P_2 - P_1 )\\\\w_p = 0.001010*( 8000 - 10 )\\\\w_p = 8.0699 \frac{KJ}{kg}

- From the following relation we can determine ( h2 ) as follows:

                          h2 = h1 + wp

                          h2 = 191.81 + 8.0699

                          h2 = 199.88 KJ/kg

                           

Second Process: Boiler supplies heat to the fluid and vaporize

- We have already evaluated the inlet fluid properties to the boiler ( pump exit property ).

- To determine the exit property of the fluid when the fluid is vaporized to steam in boiler ( super-heated phase ).

              P3 = 8 MPa

              T3 = ?  ( assume fluid exist in the saturated vapor phase )

              h3 = hg-P3 = 2758.7 KJ/kg

              s3 = sg-P3 = 5.7450 KJ/kg.K

- The amount of heat supplied by the boiler per kg of fluid to the water stream. ( qs ) is determined using the state points 2 and 3 as follows:

                          q_s = h_3 - h_2\\\\q_s = 2758.7 -199.88\\\\q_s = 2558.82 \frac{KJ}{kg}

Third Process: The expansion ( actual case ). Turbine isentropic efficiency ( nt ).

- The saturated vapor steam is expanded by the turbine to the condenser pressure. The turbine inlet pressure conditions are similar to the boiler conditions.

- Under the isentropic conditions the steam exits the turbine at the following conditions:

             P4 = 10 KPa

             s4 = s3 = 5.7450 KJ/kg.K ... ( liquid - vapor mixture phase )

             

- Compute the quality of the mixture at condenser inlet by the following relation:

                           x = \frac{s_4 - s_f}{s_f_g} \\\\x = \frac{5.745- 0.6492}{7.4996} \\\\x = 0.67947

- Determine the isentropic ( h4s ) at this state as follows:

                          h_4_s = h_f + x*h_f_g\\\\h_4_s = 191.81 + 0.67947*2392.1\\\\h_4_s = 1817.170187 \frac{KJ}{kg}        

- Since, we know that the turbine is not 100% isentropic. We will use the working efficiency and determine the actual ( h4 ) at the condenser inlet state:

                         h4 = h_3 - n_t*(h_3 - h_4_s ) \\\\h4 = 2758.7 - 0.85*(2758.7 - 181.170187 ) \\\\h4 = 1958.39965 \frac{KJ}{kg} \\

- We can now compute the work-produced ( wt ) due to the expansion of steam in turbine.

                        w_t = h_3 - h_4\\\\w_t = 2758.7-1958.39965\\\\w_t = 800.30034 \frac{KJ}{kg}

- The net power out-put from the plant is derived from the net work produced by the compression and expansion process in pump and turbine, respectively.

                       W_n_e_t = flow(m) * ( w_t - w_p )\\\\flow ( m ) = \frac{W_n_e_t}{w_t - w_p} \\\\flow ( m ) = \frac{100000}{800.30034-8.0699} \\\\flow ( m ) = 126.23 \frac{kg}{s}

Answer: The mass flow rate of the steam would be 126.23 kg/s

- The thermal efficiency of the cycle ( nth ) is defined as the ratio of net work produced by the cycle ( Wnet ) and the heat supplied by the boiler to the water ( Qs ):

                        n_t_h = \frac{W_n_e_t}{flow(m)*q_s} \\\\n_t_h = \frac{100000}{126.23*2558.82} \\\\n_t_h = 0.31

Answer: The thermal efficiency of the cycle is 0.31

       

   

7 0
3 years ago
I need ideas for what to build because I have some spare wood.
Misha Larkins [42]

Answer:

small guitar with no strings?

Explanation:

it would be fun to make i think

6 0
3 years ago
Of the cost reduction strategies for workers' compensation mentioned in the required readings, which one do you think would work
Vesnalui [34]

In industries together with production, we want people to address the manufacturing of merchandise and the usage of heavy machinery.

<h3>What is the painting situation?</h3>

In such painting situations, people are at risk of injuries, and this prices the maximum for the company. So so that you can put into effect value discount is such conditions we want to have right coincidence cowl plans for the people and make sure all of the protection precautions are taken withinside the factory.

  1. The people have to be properly educated on using protection measures and in case any injuries arise we have to have coverage claims in order that we not want to make investments extra cash and we also can offer protection and protection to the people.
  2. This approach is excellent for this enterprise due to the fact regardless of what number of precautions we take people are uncovered to fitness risks and as a result having the right coverage insurance is a superb value discount strategy.

Read more bout the compensation :

brainly.com/question/25273589

#SPJ1

3 0
1 year ago
Bending is defined as? A. the application of a load tending to distort a member in one direction. B. the application of opposing
amm1812
Hi how are you today
4 0
2 years ago
Other questions:
  • A computer maintenance company wants to 'capture' the knowledge that employees carry around in their heads by creating a databas
    5·1 answer
  • A small pad subjected to a shearing force is deformed at the top of the pad 0.12 in. The heigfit of the pad is 1.15 in. What is
    7·1 answer
  • Sam, a carpenter, is asked to identify the abilities he has that are important to his work. What are the top abilities he might
    9·2 answers
  • What is the basic formula for actual mechanical advantage?
    12·1 answer
  • A landowner and a contractor entered into a written contract under which the contractor agreed to build a building and pave an a
    14·1 answer
  • The alternator must be operated with the battery disconnected or with the terminals at the back of the alternator
    15·2 answers
  • Match the scenario to the problem-solving step it represents.
    7·1 answer
  • As you have learned, not all motor oils are the same. What are two things that make them different?.
    11·1 answer
  • Why is California a good place for engineers to build suspension bridges?
    12·1 answer
  • Give me top 5 British snacks
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!