/*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 result = seven(r); if (result) { System.out.println("WOOHOO!"); } } public static boolean seven(Random r) { for (int i = 0; i < 10; i++) { int draw = r.nextInt(30) + 1; System.out.print(draw + " "); if (draw == 7) { return true; // quits the method right away } } return false; // we only get here if the loop runs the whole way } }