Practice: Classes

Take out a piece of paper. We’ll be programming on paper.

Problem 1

Write a subroutine that takes a Player parameter. The subroutine should play a single turn of the Two-Dice Pig Game.

You can assume that the PairOfDice class exists and it has a method roll() and accessor methods getDie1() and getDie2().

Each turn in the Two-Dice Pig Game, a player repeatedly rolls two dice until a 1 is rolled or the player decides to “hold”:

The subroutine should update the Player’s score after the end of the turn.

Show me your code before you leave