CSCI 1301 Lab 8
Draw me lotsa pictures...
For Lab 8, you'll use your previously designed drawing applet from Lab 6 and
expand its capabilities as follows:
- Add an init() function to your applet that asks the user for a number of
objects to draw randomly on the screen.
- Draw that number of objects using a loop (for or while loops) and by
modifying your drawing code to shift the image to any random x, y position on
the screen.
- Modify your HTML page for the lab so that the Applet appears in a window
at least 720 wide by 480 tall, add text and background colors to the
HTML page, and link to it from your CS1301 home page.
- OPTIONAL: Add a random scale variable inside your loop that
is multiplied by all components of your drawing so that you can have your
objects drawn in different sizes (from .5 to 2.0) as well as random positions.
You'll have to multiply the x & y added components (be careful to multiply
just the added parts, not the x, y random number parts), the width and height
components, and cast all of them back to integers when done. Reward: 5 points
- enough to bring up a lower lab grade significantly...
At the top of the file, place the following lines of comments:
// FileName.java
// by Your Name
// CS1301
// Lab #
// Date
Due Thursday, November 17, ONLINE at the beginning of class. Make sure to save in a
folder (if using a USB drive) called cs1301/lab8/, as well as in a folder on
your P: drive called P:\web\cs1301\lab8. Link to the applet HTM file from your
CS 1301 home page - we will go over this once more at the beginning of class.