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
The diameter of an extruder barrel = 85 mm and its length = 2.00 m. The screw rotates at 55 rev/min, its channel depth = 8.0 mm,
babunello [35]

Answer:

Qx = 9.109.10^5 \times 10^{-6} m³/s  

Explanation:

given data

diameter = 85 mm

length = 2 m

depth = 9mm

N = 60 rev/min

pressure p = 11 × 10^6 Pa

viscosity n = 100 Pas

angle = 18°

so  Qd will be

Qd = 0.5 × π² ×D²×dc × sinA × cosA   ..............1

put here value and we get

Qd = 0.5 × π² × ( 85 \times 10^{-3} )²× 9  \times 10^{-3}  × sin18 × cos18

Qd = 94.305 × 10^{-6} m³/s

and

Qb = p × π × D × dc³ × sin²A ÷  12  × n × L    ............2

Qb = 11 × 10^{6} × π × 85 \times 10^{-3}  × ( 9  \times 10^{-3} )³ × sin²18 ÷  12  × 100 × 2

Qb = 85.2 × 10^{-6} m³/s

so here

volume flow rate Qx = Qd - Qb   ..............3

Qx =  94.305 × 10^{-6}  - 85.2 × 10^{-6}  

Qx = 9.109.10^5 \times 10^{-6} m³/s  

8 0
3 years ago
Many households in developing countries prepare food over indoor cook stoves with no ducting system to exhaust the combustion pr
lorasvet [3.4K]

Answer:

   C = 0.22857 ng / m³

Explanation:

Let's solve this problem for part the total time in the kitchen is

          t = 2h (60 min / 1h) = 120 min

The concentration (C) quantity of benzol pyrene is the initial quantity plus the quantity generated per area minus the quantity eliminated by the air flow. The amount removed can be calculated assuming that an amount of extra air that must be filled with the pollutant

amount generated

         C = co + time_generation rate / (area_house + area_flow)

         C = 0.2 + 0.01 120 / (40+ 2)

         C = 0.22857 ng / m³

7 0
3 years ago
Write a method called letterCount that takes two String arguments, one containing some text and the other containing a single le
jenyasd209 [6]

Answer:

I am writing a Python program.  Here is the function letterCount. This function takes two string arguments text and letter and return count of all occurrences of a letter in the text.

def letterCount(text, letter):  

 count = 0  # to count occurrences of letter in the text string

 for char in text:  # loop moves through each character in the text

   if letter == char: # if given letter matches with the value in char

     count += 1  # keeps counting occurrence of a letter in text

 return count # returns how many times a letter occurred in text

   

Explanation:

In order to see if this function works you can check by calling this function and passing a text and a letter as following:

print(letterCount('apples are tasty','a'))

Output:

3

Now lets see how this function works using the above text and letter values.

text = apples are tasty

letter = a

So the function has to compute the occurrences of 'a' in the given text 'apples are tasty'.

The loop has a variable char that moves through each character given in the text (from a of apples to y of tasty) so it is used as an index variable.

char checks each character of the text string for the occurrence of letter a.

The if condition checks if the char is positioned at a character which matches the given letter i.e. a. If it is true e.g if char is at character a of apple so the if condition evaluates to true.

When the if condition evaluates to true this means one occurrence is found and this count variable counts this occurrence. So count increments every time the occurrence of letter a is found in apples are tasty text.

The loop breaks when every character in text is traversed and finally the count variable returns all of the occurrences of that letter (a) in the given text (apples are tasty). As a occurs 3 times in text so 3 is returned in output.

The screen shot of program along with output is attached.

4 0
3 years ago
An aluminum alloy tube with an outside diameter of 3.50 in. and a wall thickness of 0.30 in. is used as a 14 ft long column. Ass
slega [8]

Answer:

slenderness ratio = 147.8

buckling load = 13.62 kips

Explanation:

Given data:

outside diameter is 3.50 inc

wall thickness 0.30 inc

length of column is 14 ft

E = 10,000 ksi

moment of inertia = \frac{\pi}{64 (D_O^2 -D_i^2)}

I = \frac{\pi}{64}(3.5^2 -2.9^2) = 3.894 in^4

Area = \frac{\pi}{4} (3.5^2 -2.9^2) = 3.015 in^2

radius = \sqrt{\frac{I}{A}}

r = \sqrt{\frac{3.894}{3.015}

r = 1.136 in

slenderness ratio = \frac{L}{r}

                              = \frac{14 *12}{1.136} = 147.8

buckling load = P_cr = \frac{\pi^2 EI}}{l^2}

P_{cr} = \frac{\pi^2 *10,000*3.844}{( 14\times 12)^2}

P_{cr} = 13.62 kips

3 0
3 years ago
2.1 What is the minimum number of pins required for a so-called dual-op-amp IC package, one containing two op amps? What is the
cupoosta [38]

Answer:

8 for dual-op-amp package, and 14 for quad-op-amp

Explanation;

This is because every op-amp has 2 input terminal 4 pns

So one output terminal that is 2 pins which are required for power

and the same for a minumum number of pins required by quad op amp which is 14

5 0
3 years ago
Other questions:
  • For a heat pump, COP<1. a) True b) False
    11·1 answer
  • Compared to arc welding, which of the following statements are true about<br> gas welding?
    13·1 answer
  • A 350 m^3 retention pond that holds rainwater from a shopping mall is empty at the beginning of a rainstorm. The flow rate out o
    7·1 answer
  • Air is to be heated steadily by an 8-kW electric resistance heater as it flows through an insulated duct. If the air enters at 5
    10·1 answer
  • List three reasons for surfacing metals.
    8·2 answers
  • When the Moon is in the position shown, how would the Moon look to an observer on the North Pole?
    11·1 answer
  • Need help with these 3 ez questions pls help me will mark brainiest.
    15·1 answer
  • Somebody help me!! It’s due today
    9·1 answer
  • 3. What is special about beryllium-copper alloy tools?
    6·2 answers
  • If a fuel line is routed through a compartment parallel with an electrical wire bundle, the fuel line should be installed ______
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!