Reference no: EM13168152
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
Decimal digit in bcd
: Design a combinational circuit with four input lines that represent a decimal digit in BCD and four output lines that generate the 9's complement of the input digit.
|
Evaluate a user''s expression
: Write a function that will evaluate a user's expression. It should call the getExpression function that you previously wrote to get the expression to evaluate from the user. You should evaluate the expression step-by-step.
|
Calculate the celsius equivalent of a fahrenheit temperature
: Construct a program that allows you to calculate the Celsius equivalent of a Fahrenheit temperature.
|
Create an application in which a user can enter a phone book
: Create an application in which a user can enter a phone book entry, including the following elements: First Name, Last Name, Phone Number, email address
|
The contenders are tortoise and hare
: 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 mips architecture reserves register
: The MIPS architecture reserves register 0 (called $zero) to be always equal to 0. This allows synthesizing additional addressing modes and additional instructions from the instruction set.
|
Calculates the position of a cannonball
: Write a c++ program that calculates the position of a cannonball that is fired straight up in the air. Use short time intervals (.01 seconds) and display the position and velocity every second.
|
Indicate the changes
: Indicate the changes (using the shorthand representation) that you would need to make to the original Premiere Products database design to support the following requirements. There is no relationship between customers and sales reps. When a custo..
|
You can push multiple operands on the stack
: You can push multiple operands on the stack. The operation will always use the two topmost values. For example, to evaluate (A+B+C), you can use the code below:
|