Graphic JavaScript

Back to index


This assignment requires the student to work with color and text in order to create a specific layout. This gives the student more practice at working with the fillText and fillStyle methods and it also introduces a few basic JavaScript constructs the student should be familiar with.
EXAMPLE:
This applet is an approximation of what the student will be expected to create. Inspect the code and make sure you understand how the substring method works, what value gets returned by the length property, how the modulus operator works, and how the for-loop works.
Your browser does not support the HTML5 canvas tag.

ASSIGNMENT:
The student will think of three words (two of these words should be at least five letters in length and the other should be at least eight letters long) to display in the center of the applet area. The words should be centered both vertically and horizontally. Also add two more colors to the colors array. Additionally asterisks will frame the applet area with ten along the top and bottom and seven along the right and left sides.