MIDTERM EXAM -- CST 112 (Fall 2014)
In-class portion:   (Halloween week)
(Take-home portion due next Wednesday)

Using the "Processing" language, create a "sketch" that meets the SPECIFICATIONS given below.

SYNTAX: All code must be syntactically correct; code that fails to compile (or run) will be ignored.

CODING STANDARDS: Readability of code is an important grading criteria for both the in-class and the takehome portions. Coding Standards [SEE BELOW] will be strictly enforced on the takehome portion, and credit will be deducted on the takehome portion when they are not followed.


SPECIFICATIONS

SCENE Screen is 600 pixels wide by 500 pixels high.
On the screen, display a "title" (centered, at the top) that identifies the purpose of your software, and an "author" line at the lower left) that contains your name & publication date.
The top half of the screen is the "SKY" [see below] and the lower 3/4 of the screen is the "OCEAN" [see below]. (The "surface" of the ocean is at height*3/4.)

BORDERS The top, left, and right sides of the screen are decorated with a "border".
Each border is one of the following patterns, repeated uniformly across the screen:
OPTIONAL: Make each of the three borders have a different pattern.

DAYTIME (when the boolean variable "day" is true")
During the daytime, the sky is light blue, a yellow sun appears in the upper-right portion of the sky, and a "BIRD" [see below] flies across the sky, from RIGHT to LEFT, every four seconds.
(To move 150 pixels per second, at thirty frames per second, the x value should decrease by about 5 pixels per frame.)

BIRD: (flies across the daytime sky, every four seconds)
The bird consists of two large purple triangles.

NIGHTTIME (when the boolean variable "day" is false")
During the night, the sky is darker, a pale-pink, crescent moon appears in the MIDDLE of the sky, The "WITCH" [see below] flies on her broom, across the night sky, from RIGHT to LEFT, every ten seconds, and the "OCTOPUS" [see below] slowly bobs up-and-down, from the bottom of the sea to the surface (during the nighttime only).

WITCH
The WITCH consists of a black triangular hat, a red face, a brown rectangular body, and two green legs, riding on a BROOM that has seven (7) bristles. (See image at the right.) USE A LOOP TO MAKE THE BRISTLES

The WITCH flies across the night sky, every ten seconds, from RIGHT to LEFT.

The OCTOPUS slowly bobs up-and-down, from the bottom of the sea to the surface (at night).
The octopus consists of a dark body shaped like a "mailbox" with a round top, (see image), and eight legs below. USE A LOOP TO MAKE THE LEGS. All eight legs should slant, either to the left or to the right, every few frames, when the octopus is rising, but go straight downward when the octopus is sinking.
TEXT: The following text should also appear on the screen:

EVENTS:

CLICK: Clicking causes different effects, depending upon WHERE the mouse is located. BUTTONS: Clicking on a button does the following:

CODING STANDARDS

COMMENTS:

ALSO:

BgColor=WHITE