CSCI 261 - Programming Concepts (C++)

Fall 2016 - Lab 05A

Quick Links: Blackboard | EECS | Mines | Piazza | zyBooks

|   Home |  Contact |  Syllabus |  Assignments |  Schedule |  Resources   |
This lab is due by September 28, 2016 08:00am.


Yahtzee Scorer



Today's lab is another pair programming exercise because two heads are better than one.

Each pair will be given a bag of dice with a different Yahtzee scenario/category. If you are unfamiliar with the rules of Yahtzee, here are the official Hasbro rules (.pdf). Your task is to create two different functions for each scenario. Below are each of the 13 scenarios:

ScenarioDescriptionPoints
OnesOnesSum of Ones
TwosTwosSum of Twos
ThreesThreesSum of Threes
FoursFoursSum of Fours
FivesFivesSum of Fives
SixesSixesSum of Sixes
Three Of A KindThree dice of the same valueSum of Dice
Four Of A KindFour dice of the same valueSum of Dice
Full HouseTwo dice of one value and three dice of a different value25
Small StraightFour dice in a row (1-4, 2-5, 3-6)30
Large StraightFive dice in a row (1-5, 2-6)40
YahtzeeFive dice of the same value50
ChanceAny combination of diceSum of Dice

The first function will check if the scenario is present given the five dice after they are rolled. Create a main.cpp that prompts the user to enter the values for each of the five dice. Next write the function as described on your card above your main function. Then call your function, passing as arguments the five values the user entered. Print out the result of the function to verify your function is returning the correct value.

Once the first function is working, move on to the second function described on the card. This function will determine how many points your dice will score in the given scenario (if the scenario is present). In your program, after printing if the scenario is present or not, print out how many points the user's inputs earn.

When you have both functions working, post your functions to the pinned Piazza post for this lab. We will be gathering all 26 functions for Lab05C and A05.

We recommend writing out some pseudocode for how you are going to solve these problems.


Lab Submission



You will submit your solution to this lab with the rest of Week05. Detailed instructions for doing this are posted in Assignment 05.


This lab is due by September 28, 2016 08:00am.
Last Updated: 01/01/70 00:00


Valid HTML 4.01 Strict Valid CSS! Level Triple-A conformance, W3C WAI Web Content Accessibility Guidelines 2.0