program5 - 15-100 PROGRAM 5 FALL 2007Due Monday October 8...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 15-100 PROGRAM 5 - FALL 2007Due: Monday, October 8 by 11:59PM using electronic hand-in BACKGROUND The single-player dice game Press Your Luckis played with two six-sided standard die as follows: •The player starts with $0. •The player begins rolling the dice together, scoring as follows: oIf the player rolls a total that is even, the player earns 100 ×the total of the dice roll in dollars. For example, if the player rolls a 5 and a 3 (a total of 8), the player earns $800. oHowever, if the player rolls "doubles" (two die with the same value), the amount earned for that roll is doubled. For example, if the player rolls a 2 and a 2 (a total of 4), the player earns $800 instead of the usual $400. oIf the player rolls a total that is odd, the player loses $700 and gets a "strike". •The game ends when the player earns three strikes or rolls 7 times, whichever comes first. If the player has less than $0 at the end of the game, the player wins nothing....
View Full Document

This note was uploaded on 01/25/2010 for the course CS 15100 taught by Professor Tom during the Fall '07 term at Carnegie Mellon.

Page1 / 3

program5 - 15-100 PROGRAM 5 FALL 2007Due Monday October 8...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online