import java.util.Random; import java.util.Scanner; public class Chuckaluck { public static void main(String[] args) { // prompt user for type of bet and collect it as "betType" with a scanner System.out.println("Make your bet! (enter the number for one of the options below)"); System.out.println(" 1: Single Die Bet (a specific number will appear)"); System.out.println(" 2: Any Triple"); System.out.println(" 3: Big (total > 11)"); System.out.println(" 4: Small (total < 10)"); System.out.println(" 5: Field (total outside [8,12])"); Scanner scanner = new Scanner(System.in); int betType = Integer.parseInt(scanner.nextLine()); // in the case where the user selects "Single Die Bet", // prompt user for (and get) the "numberToAppear" int numberToAppear = -1; // note: variables that are declared inside the body // of an if statement are out-of-scope outside that if statement if (betType == 1) { System.out.println("On what number appearing (1-6) would you like to bet on?"); numberToAppear = Integer.parseInt(scanner.nextLine()); } // prompt and get the betAmount, replacing any '$' chars with // empty strings (which removes these '$' chars) and finishing by // converting the resulting string to a double. System.out.println("How much money are you betting? (hit return for default of $1.23)"); String userInput = scanner.nextLine().replace("$", ""); if (userInput.isBlank()) userInput="1.23"; // default, if user hits return double betAmount = Double.parseDouble(userInput); ////////////////////// // INSERT CODE HERE // ////////////////////// } }