Program7

Program7 - import java.awt.Graphics; import...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.awt.Graphics; import java.util.Scanner; import javax.swing.JApplet; /* * Name:Xin Chi * Section:004 * Program 7 * * Implementation Plan * 1. Copy the skeleton from the web. * 2. Design: set the size of each face to be 200*200. * 3. Write the method for happy face. * 4. Write the method for sad face. * 5. Denote each face with a position (xcount, ycount). * 6. Create a boolean to test: when xcount%2 + ycount%2 - 1 is odd; print out happy face. * Otherwise print out a sad face. * * Test Plan * Run program7 to see if the output is the same as the sample screen shot. */ public class Program7 extends JApplet { public void init() { setSize(2000, 2000); } public static final int EYE_WIDTH = 10; public static final int EYE_HEIGHT = 20; public static final int FACE_DIAMETER = 200; public static final int MOUTH_WIDTH = 100; public static final int MOUTH_HEIGHT = 50; public static final int HAPPY_MOUTH_START_ANGLE = 180; public static final int HAPPY_MOUTH_EXTENT_ANGLE = 180; public static final int SAD_MOUTH_START_ANGLE = -180;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Program7 - import java.awt.Graphics; import...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online