Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LottoArray {
- public static void main(String[] args) {
- // Variables & Arrays:
- int [] array = new int [6];
- int luckyLotto = 7;
- int luckySum = 35;
- // Loops:
- System.out.println("6 random integers:");
- for(int random = 0; random < array.length; random++)
- {
- array[random] = (int)(50 * Math.random() + 1);
- System.out.println(array[random]);
- for(int l = 0; l < 1; l++)
- {
- if (array[random] == 7)
- System.out.println("You picked the lucky lotto number!");
- else
- System.out.println("You did not pick the lucky lotto number");
- }
- } // <--- end of for-loop
- for (int i = 0; i < 1; i++)
- {
- int sum = 0;
- sum = array[i] + sum;
- System.out.println("\n\nThe sum of the integer values: " + sum);
- }
- } // <--- main method ends here
- } // <--- class ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement