CSCI 201

Spring 2002

Assignment 6


Overview

You are given a self-extracting project folder as your starting point for this assignment; select this link to access that archive file. When you unpack the file, you will find a project folder containing two java files and the associated JCreator bookkeeping files.

The purpose of this program is create ASCII (i.e., text-based as opposed to graphics-based) figures. You are given a class called Figure and a class called Triangle that is derived from Figure. These classes work as follows: A triangle is specified by a margin and a size. The margin determines how far the triangle should be indented from the edge of the screen. The size establishes the width of the base of the triangle. The triangle will point up. The slope of a side of the triangle is limited to what you get by indenting one character per line (if you want to be smooth).

Your Task

Your job is to extend the program to include the following: a FilledTriangle class that draws a filled triangle, a FilledRectangle class that draws a filled rectangle, and a House class that draws 2 houses each depicted as a filled triangle sitting on top of a filled rectangle. The House class is the driver, it contains the method main(). Each class is described in more detail below.

                              *
                             ***
                            *****
                           *******
                          *********
                         ***********
                        *************
                        *************
                        *************
                        *************
                        *************
                        *************
                        *************
                        *************
                        *************
                        *************

What to Turn In

Turn in the source code for the FilledTriangle, FilledRectangle, and House classes (i.e., FilledTriangle.java, FilledRectangle.java and House.java). Remember that the files you turn in must have exactly these names. You were shown how to transfer files to your class ftp directory in lab 1, here is a quick refresher.