Questions on Section 3 - Graphics Commands

A simple house

Question 1

  1. Write an applet which draws this picture of a house:
  2. Alter the drawing of the house so that it has round windows.
  3. Add a chimney to the house and circles to represent smoke coming out of it.

Question 2

Write a two-sided joke, spacing each line as follows:

Sheep 1: Baa!
Sheep 2: Woof, woof!
Sheep 1: Why did you say woof woof instead of baa?
Sheep 2: I'm learning a foreign language.
A tree

Question 3

The diagram on the right shows a crudely drawn tree - a triangle balanced on a small rectangle with the dimensions shown. Write a method which draws this tree at a specified point on the screen. The method should take two parameters - an x co-ordinate and a y co-ordinate, representing the position of the highest point of the triangle.

Create another method which uses your first one to draw a "forest" of 10 trees at 10 positions on the screen. Your trees may "overlap" if you like.


Go back Go back to the tutorial