import javax.swing.JOptionPane;
public class VideoPokerClient
{
	public static void main(String[] args)
	{
		final int WAGER = 1;
		
		int gamesPlayed = 0;
		int winnings = 0;
		
		boolean playingAgain;
		do
		{
			VideoPoker game = new VideoPoker();
			
			gamesPlayed++;
			winnings += game.payout() - WAGER;
			
			playingAgain = JOptionPane.showConfirmDialog(null,
                                                      "Play another Video Poker game?",
                                                      "PLAY VIDEO POKER",
                                                      JOptionPane.YES_NO_OPTION)
							    == JOptionPane.YES_OPTION;
						
		} while (playingAgain );
		
		JOptionPane.showMessageDialog(null, "Games Played: " + gamesPlayed + "\n" +
														(winnings >= 0 ? "You won $" + winnings
		                                    					: "You lost $" + (-winnings)) );
	}
}