CSCI 261 - Programming Concepts (C++)

Spring 2017 - Lab 07C

Quick Links: Blackboard | Canvas | CS @ Mines | Cloud9 | Piazza | zyBooks

|   Home |  Contact |  Syllabus |  Assignments |  Schedule |  Resources   |
This lab is due by Tuesday, March 14, 2017 11:59pm.


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:

Scenario Description Points
Ones Ones Sum of Ones
Twos Twos Sum of Twos
Threes Threes Sum of Threes
Fours Fours Sum of Fours
Fives Fives Sum of Fives
Sixes Sixes Sum of Sixes
Three Of A Kind Three dice of the same value Sum of Dice
Four Of A Kind Four dice of the same value Sum of Dice
Full House Two dice of one value and three dice of a different value 25
Small Straight Four dice in a row (1-4, 2-5, 3-6) 30
Large Straight Five dice in a row (1-5, 2-6) 40
Yahtzee Five dice of the same value 50
Chance Any combination of dice Sum 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 Lab07C and can easily make our own Yahtzee game!

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 Week07. Detailed instructions for doing this are posted in Assignment 07.


This lab is due by Tuesday, March 14, 2017 11:59pm.
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