a smiley face
Time to get our feet wet.
Try coding an applet which draws a smiley face with the following restrictions:
- The face must have eyes, a nose, and a mouth.
- You should be able to draw the face anywhere on the canvas.
- You should be able to draw the face at any size; all features should resize themselves accordingly.
- The applet should be built such that you call a function drawSmiley() which takes parameters for the position and dimensions of the face. This function should in turn call the functions drawHead(), drawEyes(), drawNose(), drawMouth(), etc. to draw the different parts of the face.
- The drawSmiley() function should pass down the parameters to all the other functions in order to make all the features draw themselves in the right place and at the right size.
Here is my rendition of the smiley face.