PlayGame - case 3: countLoseWithP++;break; default: ; }...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import javax.swing.*; public class PlayGame { public static void main(String[] args){ int result; int countWinOn1 = 0, countLoseOn1 = 0, countWinWithP = 0, countLoseWithP = 0; PlayDice pg = new PlayDice(); do { result = pg.play(); switch (result){ case 0: countWinOn1++;break; case 1: countLoseOn1++;break; case 2: countWinWithP++;break;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: case 3: countLoseWithP++;break; default: ; } }while (countLoseOn1 < 100); JOptionPane.showMessageDialog(null, "Win On 1st round = "+ countWinOn1 + "\nLose On 1st round(Crap) = "+ countLoseOn1 + "\nWin With Points = " + countWinWithP + "\nLose With Points = " + countLoseWithP); } }...
View Full Document

This note was uploaded on 03/22/2012 for the course CS 55 taught by Professor Vagada during the Spring '10 term at Santa Monica.

Ask a homework question - tutors are online