You will use the Casino.java (that is provided) to drive the Roulette class (tha
ID: 3660054 • Letter: Y
Question
You will use the Casino.java (that is provided) to drive the Roulette class (that you will create). Your job is to create the Roulette class to interact with the Casino class to allow the user to play the game of Roulette. Here are the rules: Create a class named Roulette with a method named betOnce that takes, as parameters, the amount of the user bet. Generate a random number between 0 and 36 (that simulates the wheel) The user should be prompted to place their bet on 1) Low or 2) High or 3) a Number If the user selected 3) a Number, prompt the user to enter a guess between 1 and 36. If the user selectedExplanation / Answer
import java.util.*; public class Craps { public static void main(String[] args) { int points; Scanner scan = new Scanner(System.in); System.out.println("Bank Amount:"); int bankmoney = scan.nextInt(); Bank bank = new Bank(bankmoney); while (bank.getBank() > 0) { points = 0; System.out.println("Enter betting amount:"); int bet = scan.nextInt(); bank.bankSubtraction(bet); Dice dice = new Dice(); int totDice = dice.getRollAmt() + dice.getRollAmt(); System.out.println("You rolled " + totDice); if(totDice == 7 || totDice == 11) { bank.bankAddition(bet * 2); System.out.println("You have won, your current bank amount is: " + bank.getBank()); } else if(totDice == 2 || totDice == 3 || totDice == 12) { System.out.println("You have lost, your current bank amount is: " + bank.getBank()); } else { points = totDice; System.out.println("Your current pointage is " + points); totDice = 0; } } } }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.