Skip to main content
ICT
Lesson A1 - Introduction to Object Oriented Programming (OOP)
 
Main Previous
Title Page >  
Summary >  
Lesson A1 >  
Lesson A2 >  
Lesson A3 >  
Lesson A4 >  
Lesson A5 >  
Lesson A6 >  
Lesson A7 >  
Lesson A8 >  
Lesson A9 >  
Lesson A10 >  
Lesson A11 >  
Lesson A12 >  
Lesson A13 >  
Lesson A14 >  
Lesson A15 >  
Lesson A16 >  
Lesson A17 >  
Lesson A18 >  
Lesson A19 >  
Lesson A20 >  
Lesson A21 >  
Lesson A22 >  
Lesson AB23 >  
Lesson AB24 >  
Lesson AB25 >  
Lesson AB26 >  
Lesson AB27 >  
Lesson AB28 >  
Lesson AB29 >  
Lesson AB30 >  
Lesson AB31 >  
Lesson AB32 >  
Lesson AB33 >  
Vocabulary >  
 

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 Handout A1.1 - DrawingTool. 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.