Skip to main content
ICT
Lesson A1 - Introduction to Object Oriented Programming (OOP)
 
Main   Previous
 

LAB ASSIGNMENT A1.1 page 8 of 8

DrawHouse

Background:

You will be provided with a file named gpdraw.jar, which contains the code needed to implement the graphics tools to draw objects. The specifications of the drawing tools are provided in DrawingTool JavaDoc Documentation. Simply place the gpdraw.jar file in the appropriate folder location so the Java compiler can find it. Then add this line of code at the top of your program and the drawing tools are available for use.

import gpdraw.*;

Assignment:

Write a program that creates a drawing area of appropriate size (try 500 x 500) and draws a house similar to the one shown below and with these specifications:

  1. The house should fill up most of the drawing area, i.e. draw it big.

  2. The house should be centered horizontally on the screen.

  3. The house must have a sloped roof. It can be of any slope or configuration. But you cannot have a flat roof on the house.

  4. Adding a door (centered) and windows is optional.

Instructions:

  1. Include your name as a documentation statement and also a brief description of the program.

  2. You will need to turn in (either on paper or electronically) a copy of your code and a picture of the house that resulted.

 

Main   Previous
Contact
 © ICT 2006, All Rights Reserved.