Question
Everytime I go to execute my code I am getting 7 errors. Please tell me how I could possibly fix the following code: import java.awt.*;
Everytime I go to execute my code I am getting 7 errors. Please tell me how I could possibly fix the following code:
import java.awt.*;
public class Roulette { public static void main(String[] args) { new Roulette(); } class addLabel{ lMoney
public void makeBet() { do { betting = inputInt("How much do you want to bet?"); } while (betting < 0 || betting > money); bet = betting; { while (money > 0) { System.out.print("You have $" + money + ". Place your bet: " ); int bet = console.nextInt(); while (bet > money) { System.out.println("You bet too much: $" + bet); System.out.print("You have $" + money + ". Place your bet: " ); int bet = console.nextInt(); } } } choice = input("Betting on : Red, Black, or a Number"); tBet.setText(betting + ""); tChoice.setText(choice); } public int rand(int lowest, int highest) { return (int)(Math.floor(Math.random()*(highest-lowest+1)+lowest)); }
public void spin() { long start = System.currentTimeMillis(); do { int num = rand(0,36); tNumber.setText( num + ""); if (num == 0) { tNumber.setBackground(Color.green); } else if ( ((num-1)/3) % 2 == 0 ) { tNumber.setBackground(Color.red); } else { tNumber.setBackground(Color.black); } repaint(); } while (System.currentTimeMillis()-start < 3000); money = money + checkWinner(); tMoney.setText(money + ""); } public int checkWinner() { if ((tNumber.getBackground() == Color.red) && (tChoice.getText().equals("Red"))) { return bet; } else if ((tNumber.getBackground() == Color.black) && (tChoice.getText().equals("Black"))) { return bet; } else if (tNumber.getText().equals( tChoice.getText() ) ) { return 36*bet; } else { return -bet; } } public void pause(long millis) { long start = System.currentTimeMillis(); do { } while (System.currentTimeMillis() - start < millis) ; } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started