The contenders are tortoise and hare

Assignment Help Basic Computer Science
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

Reference no: EM13168152

Questions Cloud

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:

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd