/*Write a method seven that accepts a Random parameter and uses it to draw up to ten lotto numbers from 1-30. If any of the numbers is a lucky 7, the method should stop and return true. If none of the ten are 7 it should return false. The method should print each number as it is drawn. 15 29 18 29 11 3 30 17 19 22 (first call) 29 5 29 4 7 (second call) */ import java.util.*; public class Lotto { public static void main(String[] args) { Random r = new Random(); boolean gotASeven = seven(r); System.out.println(gotASeven); } // This code has a tragic bug. Can you spot it? // picks up to 10 lotto numbers. If a 7 is picked, stops and returns true. // If no 7 was picked, returns false after 10. public static boolean seven(Random rand) { for (int i = 0; i < 10; i++) { int num = rand.nextInt(30) + 1; System.out.print(num + " "); if (num == 7) { return true; } else { return false; } } } }