CSCI 161 — Lab 8

Due: Tuesday, October 31, 2017 @ 1:00PM

Overview

It's halloween! You have been tasked with drawing a spooky pumpkin during the lab period!

You can download the starter code from HERE

Input Specification

None

Output Specification

A spooky halloween-themed picture. A pumpkin must be displayed.

Required Methods

You must implement the following methods in Halloween.java:

/**
 * Generate a random number within a range
 *
 * @param rand the random number generator
 * @param low minimum value for range
 * @param high maximum value for range
 * @return an integer value in the range of [low,high]
 */
public static int randomBetween(Random rand, int low, int high) {
    // TODO you need to implement this method
    return 0;
}

/**
 * Generate a random color with passed bounds
 * @param rand the random number generator
 * @param rLow minimum value for red
 * @param rHigh maximum value for red
 * @param gLow minimum value for green
 * @param gHigh maximum value for green
 * @param bLow minimum value for blue
 * @param bHigh maximum value for blue
 * @return a random color within the proper bounds
 */
public static Color randomRGBColor(Random rand, int rLow, int rHigh, int gLow, int gHigh, int bLow, int bHigh) {
    // TODO you need to implement this method
    // hint: call randomBetween 3 times with appropriate parameters

    // you will return something like:
    // new Color(randRed, randGreen, randBlue);
    return null;
}

public static Color randomOrange(Random rand) {
    // TODO you need to implement this method
    // hint: call randomRGBColor() with appropriate parameters
    return null;
}

Once you implement these methods, change the draw method to meet the following requirements:

Drawing methods

Color methods

We will have an informal competition at the start of class on Thursday. The top three will each receive 5 bonus points on the exam.

Submission

Upload your modifed Halloween.java on autolab under the "Lab 8" assignment.

Grading

You must call me over to look at your submission before the end of the class period.

You will earn full marks if you meet all of the requirements.