Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due
You are asked to program a game called Monopoly in C++. This game is played by two players (you and computer in this assignment). The game and its rules are described as the follows.
• Account Setup:
Each player must establish an account with a positive balance, starting with a deposit of 5000 units. This means that you have to set up a data base (a file) which records the players’ information, for example, name, gender and account balance etc. and the program is supposed to be able to track the balance changes as the game is going.
This game is played on a game board as shown in Fig. 1, consisting of 38 squares. Each square, except for the four corner squares (the "GO" square, two "CASSINO" squares, and the "JAIL" square), has a price tag for ownership, with prices randomly generated within the range of 10 to 300.
All players begin at the "GO" square, and each time a player passes the "GO" square, their account balance is increased by 200 units.
You and the computer take turnsto roll a dice. The outcome of each rolling (a random number withinthe range of 1 to 6) decides how many squares you/computer can advance in a clockwise direction on the board.After you have landed on a square:
- The fine is topped at 20% of the square price even if more than 2 consecutive squares havebeen occupied by your opponent.
Landing on the "JAIL" square requires the player to wait for one round before moving again;
Landing on a "CASSINO" square prompts the player to decide whether to gamble. If the player declines, nothing happens. If the player accepts, they must place a bet, and the casino rolls a dice.
The player must predict if the outcome will be greater than 3 or not. A correct prediction results in a reward of twice the bet, while an incorrect prediction results in the loss of the bet;
The game ends under three scenarios:
-Aplayer declares bankruptcy (balance is less than or equal to 0);
- Aplayer's account balance exceeds 15,000 units;
Fig. 1 Game Board