View Single Post
  #3 (permalink)  
Old 11-02-2007, 11:14 PM
notnumber6 notnumber6 is offline
Member
 
Join Date: Nov 2007
Posts: 8
notnumber6 is on a distinguished road
Hey JavaBean,

Really like the code, have changed the variable names so i hope you can still understand it but the method where ... is, what shall i put here?

Code:
import java.lang.*; import java.util.*; import java.io.*; import java.net.*; public class LoteryApp extends Object { public static void main(String[] argStrings) throws Exception { Random random = new Random(); int[] lotteryNumbers = new int[5]; int bonusBall = random.nextInt(49); for (int index = 0; index < lotteryNumbers.length; index = index + 1) { while (!hasNotBeingPicked(beforeCheck)) { beforeCheck = random.nextInt(49); } lotteryNumbers[index] = beforeCheck; } private boolean hasNotBeingPicked(int[] lotteryNumbers, int currentIndex, int currentNumber) { ... } System.out.println("Your lucky numbers are:"); for (int index = 0; index < lotteryNumbers.length; index = index + 1) { System.out.println(lotteryNumbers[index]); } System.out.println("Your Bonus Ball is:"); System.out.println(bonusBall); } }
Reply With Quote