CS Instructions

a guest Mar 18th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Instructions:
  2. Fly By Night Games Company was so impressed with your work on Chutes and Ladders they have hired you once again to supply a specialized version of Monopoly. Based on the buildings at Seattle University and with a simplified rule structure, you will allow two to six people to play the game.
  4. Each player begins with $1500 dollars to use in purchasing buildings.
  5. When a player lands on an owned building he/she must pay rent.
  6. The first space is called "Go" and when a player passes "Go" he/she collects a salary of $200 from the "bank".
  7. There are spaces containing items that cannot be owned - these direct a player to roll in order to select an action or to pay a fee (like Fee or Tax) or just allow a rest (like the Chapel of St. Ignatius).
  8. The game ends when one player is out of money - the winner is the one with the most money.
  9. Players move by rolling two dice and moving from 2 to 12 spaces around the board. Once a player reaches the last space, they return to "Go". If the player passes "Go", they collect $200 from the "bank" and do the following:
  11. If the player lands on an unowned building (designated by an owner = 0), they can choose to purchase the building or not (they must have enough money).
  12. If the player lands on a "Chance" location, they roll a single die
  13. A roll of 1, 2, or 3 gives them a bonus of $50.
  14. Any other roll moves them immediately to the Chapel of St. Ignatius or Office of Dean Quinn (whichever is closer) for a rest.
  15. Passing "Go" to get to the Chapel/Dean's office does NOT get the player $200.
  16. If the player lands on a building owned by another player (designated by that player's number), they pay the other player the appropriate amount of rent.
  17. If the player lands on "Income Tax", they pay $200 to the "bank".
  18. Track property ownership by way of an integer attribute where
  20. -1 means the building cannot be owned
  21. 0 means the building can be owned but currently has no owner
  22. any other number indicates which player owns the building
  23. The board information is stored in a file called "p4input.dat". The final program should connect to the file through a constant string so the input file doesn't need to be copied to each student directory, as in:
  25. const string FILENAME = "/home/fac/ohsh/submit/19wq1420/files/p4input.dat";
  26. The format for the file is:
  28. Name (string, may have spaces)
  29. Owner (integer, -1 for cannot be owned, 0 for no current owner)
  30. Cost to purchase (integer, up to 3 digits)
  31. Cost to rent or amount of fee (integer, up to 3 digits)
  33. and the file contents: P4: Input File Contents
  35. TODO:
  36. Use the instructor's starter code by copying the "p4.cpp" file into your working directory:
  38. cp /home/fac/ohsh/submit/19wq1420/files/p4.cpp .
  39. Note the dot (.) at the end of the line, after a space. There is also a space after the command "cp".
  40. Do not make any changes to the function prototypes included in the instructor's starter code; however, feel free to include any additional "helper" functions to ensure that all functions do one task and only one task.
  41. Complete the implementation of the following functions (marked by TODO):
  43. main
  44. fillBoard
  45. resetBoard
  46. playerSetup
  47. takeTurn
  48. checkSpecialLocation
  49. payRent
  50. buyProperty
  51. displayCashAndProperties
  52. Notes:
  54. When the user begins the game, read in the file to prepare the board (an array of structs).
  55. There will be no more than 45 spaces on the board.
  56. Ask for the number of players (only allow from 2 to 6) and request their names (an array of structs).
  57. For each player you must track their name, current position on the board, and the amount of money they still have (initialized to 1500).
  58. Let player 1 take the first turn; play proceeds in player-number order.
  59. As soon as one person loses all their money, the game ends.
  60. The winner is the one with the most money when the game ends.
  61. Allow the user to play again with a new set of players.
  62. number of players is between 2 and 6 and different names may be associated with these players.
  63. To compile your program, type:
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand