The contenders are Tortoise and Hare, and they begin race as investors at "tile 1" of 70 tiles The finish line is at 70 the tile. With each tick of the clock , the program should use function of moveTortoise and moveHare. The functions should use pointer-based pas-by-reference to modify the position of the tortise and the Hare. Use variable to keep track of the positions of the animals(i.e position numbers are 1-70). For each tick of the clock, display a 70-position line showing the letter T in the tortoise's position and letter H in the Hare's position.
Implement a class Tile with the following propertises:
- Admission Cost(randomize cost between $3 and $10)
- Tile Cost(randomize cost between $6 and $20)
- Cost to build one Green hose(5 xTile Cost)
- Green House Count
- Investor *owner
- void place(Investor*) - Function is called to place Investor on Tile
Implement a class Investor with the following propertises:
- Name of Investor
- Cash Savings Balance (initialize to $1500)
- Total vale of assets(initialize to $0)
- void savingsdeposit(double amount) - Deposits money into cash savings balance
- void assetDeposit(double amount) - add to the vale of assets
- double withdraw(double amount)
The race between two investors (Tortoise and Hare) who are both trying to race through a series of tiles without going bankrupt. If an investor goes bankrupt before they cross the finish line then they are out of the race. The investor who gets to the finish line first without going bankrupt will win a vacation away from the money making game.
RULES FOR LANDING ON A TILE:
- If an investor lands on a tile and has sufficient money to purchase tile (provided the tile has not been sold), then the investor must purchase that Tile. Remember to update the total value of assets for this investor.
- If an investor lands on a tile that is owned by a different investor then that investor must pay the admission cost to the owner.
- If an investor lands on a tile that he/she already owns then it must try to purchase a Green House (remember to increment green house count)
- If the investor doesn't have enough cash to purchase an available tile then do nothing.
- The admission cost of a tile with one or more green house is:
Sample output after the race:
Investor: Hare
Cash Savings Balance: $5000
Total Value of Assets: $18000
Investor: Tortoise
Cash Savings Balance: $3000
Total Value of Assets: $4000