package com.example.casino;

import java.util.Scanner;

import com.example.games.AlwaysLose;
import com.example.games.Blackjack;
import com.example.games.CoinFlip;
import com.example.games.SimpleCraps;

public class Casino {
	public static void main(String[] args) {
		int totalCash = 100;
		
		while(totalCash > 0) {
			System.out.println("Welcome to the casino! You have $" + totalCash);
			
			System.out.println("1. Blackjack");
			System.out.println("2. Coin Flip");
			System.out.println("3. Always Lose");
			System.out.println("4. SimpleCraps");
			
			System.out.println("Enter a number to choose:");
			
			Scanner myScanner = new Scanner(System.in);
			
			int selection = myScanner.nextInt();
			
			BettingGame game;
			
			if(selection == 1) {
				game = new Blackjack();
			} else if (selection == 2) {
				game = new CoinFlip();
			} else if (selection == 3) {
				game = new AlwaysLose();
			} else if (selection == 4) {
				game = new SimpleCraps();
			} else {
				System.out.println("Invalid choice--Enter a nuber between 1-4");
				continue;
			}
			
			System.out.println("Enter a bet amount: ");
			
			int betAmount = myScanner.nextInt();
			
			while(betAmount < 0 || betAmount > totalCash) {
				System.out.println("Invalid bet amount. Please enter an amount between 1 and " + totalCash);
				
				betAmount = myScanner.nextInt();
			}
			
			int amountWon = game.playGame(betAmount);
			
			if(amountWon > 0) {
				System.out.println("You won $" + amountWon);
			} else {
				System.out.println("You lost $" + -amountWon);
			}
			totalCash += amountWon;
		}
	}
}

@@ -22,16 +22,44 @@
 asino;%0A%0A
+import java.util.ArrayList;%0A
 import j
@@ -339,16 +339,203 @@
  %3E 0) %7B%0A
+%09%09%09ArrayList%3CBettingGame%3E games = new ArrayList%3C%3E();%0A%09%09%09%0A%09%09%09games.add(new Blackjack());%0A%09%09%09games.add(new CoinFlip());%0A%09%09%09games.add(new AlwaysLose());%0A%09%09%09games.add(new SimpleCraps());%0A%09%09%09%0A
 %09%09%09Syste
@@ -549,16 +549,18 @@
 rintln(%22
+%5Cn
 Welcome 
@@ -611,124 +611,86 @@
 %0A%09%09%09
-System.out.println(%221. Blackjack%22);%0A%09%09%09System.out.println(%222. Coin Flip%22);%0A%09%09%09System.out.println(%223. Always Lose%22
+for(int x = 0; x %3C games.size(); x++) %7B%0A%09%09%09%09BettingGame game = games.get(x
 );%0A
+%09
 %09%09%09S
@@ -711,26 +711,50 @@
 tln(
-%224. SimpleCraps%22);
+(x + 1) + %22. %22 + game.getGameName());%0A%09%09%09%7D
 %0A%09%09%09
@@ -950,58 +950,15 @@
 ion 
-== 1) %7B%0A%09%09%09%09game = new Blackjack();%0A%09%09%09%7D else if (
+%3E 0 && 
 sele
@@ -967,163 +967,61 @@
 ion 
-== 2) %7B%0A%09%09%09%09game = new CoinFlip();%0A%09%09%09%7D else if (selection == 3) %7B%0A%09%09%09%09game = new AlwaysLose();%0A%09%09%09%7D else if (selection == 4) %7B%0A%09%09%09%09game = new SimpleCraps(
+%3C= games.size()) %7B%0A%09%09%09%09game = games.get(selection - 1
 );%0A%09

Use ArrayList for games