Here is my code!! Please Help!!!!!!!!!!!!!! i have to turn in the assignment on Monday!!
MAIN:
package game; import javax.swing.JOptionPane; public class Game { /** * @param args the command line arguments */ public static void main(String[] args) { JOptionPane.showMessageDialog(null,"********Welcome to The Slot Machine Game!********"); String name = JOptionPane.showInputDialog("Please enter your name"); double money; money = Double.parseDouble(JOptionPane.showInputDialog("How much money do you have?")); double currentBalance = money; int coins = (int)(money/0.25); int coinsBet = Integer.parseInt(JOptionPane.showInputDialog("How many coins do you want to bet? (0-4)")); if(coins == 0 || coins > 4){ JOptionPane.showMessageDialog(null, "Hello " +name + "," + "your current balance is " +currentBalance +"\n" + "You bet " + coinsBet + "coin(s)" +"\nBye-Bye!");} while(coins!=0){ currentBalance= currentBalance-(coins*0.25); JOptionPane.showMessageDialog(null, name +", your current balance is " +currentBalance ); JOptionPane.showInputDialog("how many coins do u wanna bet?"); } } } package game; import game.SlotMachine; /** * * @author Syeda */ public class PullResult { private String column1; private String column2; private String column3; public PullResult(String column1, String column2, String column3){ } public String getColumn1(){ return column1;} public String getColumn2(){ return column2;} public String getColumn3(){ return column3;} public int getPayoff(){ return getPayoff(this.column1,this.column2,this.column3); } public static int getPayoff(String column1, String column2, String column3){ int payoff; int result = 9; if (column1.equals("BELL") && column2.equals("BELL") && column3.equals("BELL")) { result = 0; } else if (column1.equals("GRAPE") && column2.equals("GRAPE") && column3.equals("GRAPE")) { result = 1; } else if (column1.equals("CHERRY") && column2.equals("CHERRY") && column3.equals("CHERRY")) { result = 2; } else if (column1.equals("CHERRY") && column2.equals("CHERRY")) { result = 3; } else if (column1.equals("CHERRY") && column3.equals("CHERRY")) { result = 4; } else if (column2.equals("CHERRY") && column3.equals("CHERRY")) { result = 5; } else if (column1.equals("CHERRY")) { result = 6; } else if (column2.equals("BELL")) { result = 7; } else if (column3.equals("BELL")) { result = 8; } switch (result) { case 0: payoff = 8; break; case 1: payoff = 5; break; case 2: payoff = 4; break; case 3: case 4: case 5: payoff = 2; break; case 6: case 7: case 8: payoff = 1; break; default: payoff = 0; } return payoff; } } package game; import java.util.ArrayList; import java.util.List; import java.util.Random; public class SlotMachine { public static PullResult getPullResult(){ List<String> list = new ArrayList<String>(); list.add("BELL"); list.add("GRAPE"); list.add("CHERRY"); Random rg = new Random(); int size = list.size(); String column1 = list.get(rg.nextInt(size)); String column2 = list.get(rg.nextInt(size)); String column3 = list.get(rg.nextInt(size)); return new PullResult(column1, column2, column3); } }
it is not showing the result from PullResult class