Program Design & Testing Document for Program 5 Lyell C Read Solution




Problem Statement


The problem asks me to create a c++ version of the Yahtzee game. This game must:


  • Supports n players, and this choice must be made when the executable is executed, in the command line.


  • 5 dice roll 3 times with the ability to keep dice.


  • Dice and Scoresheet stored in an array


  • Choice not to roll again


  • 35 point bonus for >63 in top part of scoreboard


More requirements (credit: Justin Goins, Canvas):


  • Print an error message and recover, when the player doesn’t supply a valid category. This includes selecting a category with a score, which can include a zero for the score. Make sure to carefully consider this when you are designing your program!


  • Print an error message when the user enters an invalid option as a command line argument. You do not need to recover from this.


  • Correctly determine the score for the category based on the dice (Remember, if the dice do not match the rules for the category, then a zero score is placed in that category).
  • Play the game correctly based on rules and number of players.


  • Continue to play until the user selects no.


  • You must not have any global variables


  • You must use a dynamic 1-d array for the second player’s scoresheet, since there may or may not be a second player.


  • Your functions need to focus on performing a particular task. In other words, you need to use good modular design. If your function uses more than about 20 lines of code, this may be an indication that the code should be split into multiple functions. If the TA notices that your code is not sufficiently modular, you will lose points.


  • You must not have memory leaks.


  • Segmentation faults are not allowed (e.g. your program crashes).






error: Content is protected !!