Comp 170-201 -- Dordal/Nabicht -- Lab 2, Wed, Sept 4, 2002 Due: Wed Sept 11 (but may be turned in without penalty through Sept 13). You are to: 1. log in 2. find a place to save your work (csmount/floppy/whatever) 4. launch BlueJ 5. create a new project 6. create an *applet* class 7. edit your applet's paint() so it draws 100 random circles (random position and random diameter; see the notes below) 8. compile and run your program 9. turn in a printed copy of the program and the output, or email me just the program. To add an applet class to your new project, use the New Class button. You will be prompted for a name; Bubbles is one possibility. Click on the "Applet" radio button to get an applet class. Once the new class has appeared, double-click on it to edit it. Find the paint() function. **Comment out or delete the demo text**; you will not receive full credit unless you do. To create 100 circles, use a while loop: int i = 0; while (i<100) { g.drawOval(....); i++; } Be careful with the { and } in the while loop; if you mess these up, the error message you get isn't likely to make much sense. The circles should be *positioned* at random, and have random *diameter*. Assume the x and y coordinates are ints < 500; given an instance named "gen" of class Random (Random gen = new Random()), you can create random numbers in the appropriate range with gen.nextInt(500) The x and y values are each a *different* random value; the diameter is a third value (assume the diameter < 100; see the notes handout for that). You will need to add a declaration of a Random, and put appropriate calls to nextInt(500) and nextInt(100) inside the body of the loop above. For example, as in the notes handout you will have, *inside the loop*, diameter = gen.nextInt(100); // assuming your Random is "gen" Declarations (and construction) of variables should *not* go inside the loop! If you want to get fancy, you can make the color random too. 8-) To get *really* fancy, you'd choose the coordinates of the *center* of the circle to be randomly chosen numbers < 500, not the upperleft "corner". Can you figure out how to do this?