Due: Tuesday, October 31, 2017 @ 1:00PM
It's halloween! You have been tasked with drawing a spooky pumpkin during the lab period!
You can download the starter code from HERE
None
A spooky halloween-themed picture. A pumpkin must be displayed.
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:
drawRectangle
must be called at least oncefillRectangle
must be called at least oncefillArc
must be called at least oncedrawCircle
must be called at least oncefillCircle
must be called at least oncerandomRGBColor
at least oncerandomHSVColor
at least oncerandomOrange
at least onceWe will have an informal competition at the start of class on Thursday. The top three will each receive 5 bonus points on the exam.
Upload your modifed Halloween.java
on autolab under the "Lab 8" assignment.
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.