Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Sammy Samkough
- // Lottery
- // Spec: Use a Lottery object to simulate a 6 / 49 Lottery – that is, a 6 number lottery with numbers ranging from 1 to 49
- // with no duplicates.
- public class LotteryArray
- {
- private int[] inputNums;
- private int[] winNums;
- public LotteryArray()
- {
- }
- public LotteryArray(int[] num)
- {
- inputNums = new int[6];
- winNums = new int[6];
- num = inputNums;
- }
- // generating 6 random values
- public void setNumbers()
- {
- for (int i = 1; i < 6; i++)
- {
- winNums[i] = (int) (Math.random() * 49) + 1;
- }
- if (inputNums == winNums)
- {
- System.out.println("YOU WON!");
- }
- else
- {
- System.out.println("You lost!");
- }
- }
- // to check for duplications in the inputted numbers
- public boolean hasDups (boolean valid)
- {
- if (inputNums == inputNums)
- {
- return false;
- }
- else
- {
- return true;
- }
- }
- public String toString()
- {
- String result = "";
- return result;
- }
- }
- -------------------------------------------------------------------------------------------------------------------------------
- // Sammy Samkough
- // Lottery
- // Spec: Use a Lottery object to simulate a 6 / 49 Lottery – that is, a 6 number lottery with numbers ranging from 1 to 49 with
- // no duplicates.
- import java.util.Collections;
- import java.util.List;
- import java.util.ArrayList;
- public class LotteryArrayList
- {
- public LotteryArrayList()
- {
- }
- }
- -------------------------------------------------------------------------------------------------------------------------------
- // Sammy Samkough
- // Lottery
- // Spec: Use a Lottery object to simulate a 6 / 49 Lottery – that is, a 6 number lottery with numbers ranging from 1 to 49 with
- // no duplicates.
- import java.util.Collections;
- import java.util.List;
- import java.util.ArrayList;
- import java.util.Scanner;
- public class LotteryClient
- {
- public static void main(String args[])
- {
- Scanner sc = new Scanner(System.in);
- LotteryArray l1 = new LotteryArray();
- }
- }
- /*
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement