I have this program I'm writing. I need help with the bet part of the program. I'll give you an idea of what I'm doing:
The player starts with $500. He can bet between 0 and his current amount left on next turn. If he bets 0 the game is over and you should print his remaining amount.He rolls 1 12 sided die. The computer rolls 2 6 sided dice.Add the 2 computer dice together.Compare the numbers. If the player number is bigger he wins his bet. If the computer number is bigger the player loses his bet. If the numbers are the same, but over 7 the player wins his bet and if the numbers are the same, but the numbers are lower than 7 the computer wins the bet. If the number is 7, the bet is a tie and the total will not change.
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.lang.*;
import javax.swing.*;
import java.text.DecimalFormat;
import java.util.*;
public class DiceGame1 extends Frame
{
public static void main(String[] args)
{
//declare variables
int startingAmount;// starting amount
double playerBet;// what the player bets
int computerRoll;//the computer's roll
int computerDie; //computers overall total rolls
int playerRoll;//the player's roll
double aRandomNumber;
double amount;
//Starting Input
startingAmount = 500;
playerBet=0;
amount=0;
System.out.println("Starting Value of $" +startingAmount);
JOptionPane.showInputDialog(null,"Enter Your Bet:");
//Random number's generator for player.
playerRoll = 1+(int)(Math.random()*12);
System.out.println("Your Roll:" +playerRoll);
//Random number's generator for the computer.
computerRoll = 1+(int)(Math.random()*6);
computerDie = computerRoll + computerRoll;
System.out.println("Computer's Roll:" + computerDie );
//Calculation
if(playerRoll > computerRoll)
{
System.out.println("YOU WIN !");
}
else if (computerRoll > playerRoll)
{
System.out.println("YOU LOSE");
}
if((computerRoll = playerRoll) >7)
{
System.out.println("Winner");
}
else if((computerRoll= playerRoll) <7)
{
System.out.println("Loser");
}
else if((computerRoll = playerRoll)=7)
{
System.out.println("Tie");
}
}}