House Assignment
Assignment 1

25 points

Create an applet, and name the class House. BlueJ will automatically create methods that are commonly used in applets. Do not erase these methods. Find the paint method, and inside of the paint method create a house. You must use the methods which are defined in the Graphics class.

Graphics JavaDocs

Your house must contain 2 windows which are yellow in the inside.
Your house must have a door.
Your house must have a triangular roof.
You must use the drawLine method at least once.
You must use the drawRect( can substitute with draw3DRect or fill3DRect or fillRect) method at least once.
You must include the title My First House above the house.
You may add additional features for a maximum of 5 points extra credit Example:



The Face and Inheritance
Assignment 2

25 points

1. Copy and paste the Face class into a project for Assignment 2.
2. Fill in the following methods: drawFace, drawEyes, drawNose, drawMouth
Below is an example of what your face may look like:

Example:



Copy the Face Class below. It is very long, make sure you copy everything.

3. Create another class called HappyFace, which extends Face.(Do not select Applet for Class Type). Erase all the methods and contructors BlueJ created, so that the class is empty. Below is an example of what your HappyFace class should look like after you erase everything:



Since it extends the class Face, it inherits all the methods that a Face class has. So, Run this Applet. Notice that even though you have not written any code inside this class, it does exactly the same thing as the Face class, because it has inherited all of it’s methods.

4. The difference between, Face and HappyFace is the mouth. So we will only add one method to happy face class which is the drawMouth method. This method will replace(overwrite) the drawMouth you already wrote in Face.


5. Once you have change the drawMouth method so that the mouth is curved, run the applet. Everything should be exactly the same as the Face class, except for the mouth.

6. Create three more classes called WinkingFace, SleepingFace, and EvilFace. Each of these classes should extend the Face class, just as the Happy face class did. Then overwrite the methods that pertain to the part of the face that will be different than the parent class Face. Remember, your class will inherit all the methods from the Face class, and the methods you add should overwrite or replace various methods that you don't want to be inherited.