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
.If aligned and continuous carbon fibers with a diameter of 6.90 micron are embedded within an epoxy, such that the bond strengt
Alina [70]

Answer:

the required minimum fiber length is 0.80365 mm

Explanation:

Given the data in the question;

Diameter D = 6.90 microns = 6.90 × 10⁻⁶ m

Bond strength ζ = 17 MPa

Shear yield strength ζ_y = 68 Mpa

tensile strength of carbon fibers 6t_{fiber = 3960 MPa.

To determine the minimum fiber length we make use of the following relation;

L = (6t_{fiber × D) / 2ζ

we substitute our given values into the equation;

L = ( 3960 × 6.90 × 10⁻⁶) / (2 × 17 )

L = 0.027324 / 34

L = 0.000803647 m

L = 0.000803647 × (1000) mm

L = 0.80365 mm

Therefore, the required minimum fiber length is 0.80365 mm

7 0
3 years ago
Which of the following can minimize engine effort in save fuel
pentagon [3]

Answer:

hmm

Explanation:

How to Save Fuel

Keep your vehicle's engine in good condition.

Maintain proper air pressure in your tires.

The faster you travel, the greater your fuel consumption is.

Try to speed up gradually when you stop for a traffic light.

Try to drive smoothly.

Do not allow your engine to idle.

hope this helps

7 0
3 years ago
Read 2 more answers
g A 30-m-diameter sedimentation basin has an average water depth of 3.0 m. It is treating 0.3 m3/s wastewater flow. Compute over
stepladder [879]

Answer:

The overflow rate is 4.24×10^-4 m/s.

The detention time is 7069.5 s

Explanation:

Overflow rate is given as volumetric flow rate ÷ area

volumetric flow rate = 0.3 m^3/s

area = πd^2/4 = 3.142×30^2/4 = 706.95 m^2

Overflow rate = 0.3 m^3/s ÷ 706.95 m^2 = 4.24×10^-4 m/s

Detention time = volume ÷ volumetric flow rate

volume = area × depth = 706.95 m^2 × 3 m = 2120.85 m^3

Detention time = 2120.85 m^3 ÷ 0.3 m^3/s = 7069.5 s

6 0
3 years ago
The number of weaving errors in a twenty-foot by ten-foot roll of carpet has a mean of 0.8 What is the probability of observing
Viktor [21]

Answer:

0.14% probability of observing more than 4 errors in the carpet

Explanation:

When we only have the mean, we use the Poisson distribution.

In a Poisson distribution, the probability that X represents the number of successes of a random variable is given by the following formula:

P(X = x) = \frac{e^{-\mu}*\mu^{x}}{(x)!}

In which

x is the number of sucesses

e = 2.71828 is the Euler number

\mu is the mean in the given interval.

The number of weaving errors in a twenty-foot by ten-foot roll of carpet has a mean of 0.8.

This means that \mu = 0.8

What is the probability of observing more than 4 errors in the carpet

Either we observe 4 or less errors, or we observe more than 4. The sum of the probabilities of these outcomes is 1. So

P(X \leq 4) + P(X > 4) = 1

We want P(X > 4). Then

P(X > 4) = 1 - P(X \leq 4)

In which

P(X \leq 4) = P(X = 0) + P(X = 1) + P(X = 2) + P(X = 3) + P(X = 4)

P(X = x) = \frac{e^{-\mu}*\mu^{x}}{(x)!}

P(X = 0) = \frac{e^{-0.8}*(0.8)^{0}}{(0)!} = 0.4493

P(X = 1) = \frac{e^{-0.8}*(0.8)^{1}}{(1)!} = 0.3595

P(X = 2) = \frac{e^{-0.8}*(0.8)^{2}}{(2)!} = 0.1438

P(X = 3) = \frac{e^{-0.8}*(0.8)^{3}}{(3)!} = 0.0383

P(X = 4) = \frac{e^{-0.8}*(0.8)^{4}}{(4)!} = 0.0077

P(X \leq 4) = P(X = 0) + P(X = 1) + P(X = 2) + P(X = 3) + P(X = 4) = 0.4493 + 0.3595 + 0.1438 + 0.0383 + 0.0077 = 0.9986

P(X > 4) = 1 - P(X \leq 4) = 1 - 0.9986 = 0.0014

0.14% probability of observing more than 4 errors in the carpet

5 0
3 years ago
Technician a says that diesel engines can produce more power because air in fuel or not mix during the intake stroke. Technician
mariarad [96]

Answer:

Technician be says that diesel engines produce more power because they use excess air to burn feel who is correct

Explanation:

He is correct as many engines are run by diesel. It produces more power as that is how cars produce more power.

3 0
2 years ago
Other questions:
  • A curve with 0.3 m constant radius contains a bead that is moving on it such that its rotational velocity is 3t2 sec-1. If the b
    12·1 answer
  • Given the following materials and their corresponding thermal conductivity values, list them in order from most conductive to le
    12·1 answer
  • A rectangular block having dimensions 20 cm X 30 cm X 40 cm is subjected to a hydrostatic stress of -50 kPa (i.e. under compress
    15·1 answer
  • Why do electricians require critical thinking skills? In order to logically identify alternative solutions to problems in order
    8·1 answer
  • 5) Initially, the pressure and temperature of steam inside a solid capsule is at 100-pound force per square inch absolute (psia)
    6·1 answer
  • Reusable refrigerant containers under high-pressure must be hydrostatically tested how often?
    10·1 answer
  • How do i do this? if y’all don’t mind helping lol
    13·1 answer
  • What is government role in the modern American version of capitalism
    11·1 answer
  • What Number Am I?
    13·1 answer
  • How might a field like philosophy of history help scientists​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!