CS 5253	Workshop I								Semester A 2001-2002

Assignment 3: Object-oriented Graphic Library Design	

Question 1.   Due date for demo :  week 11 for 61 (week 12 is also O.K. if you can not make it) and week 12 for 62.    (The report and the program list can be submitted in week 14 on Monday in a mail Box that I will book later)  

In this assignment, you are required to design and implement a simple object-based graphic library using C++. This library does not need to support a full set of graphic functions. For example, functions that draw an object on the screen are not needed. The objective of this assignment is for you to practice the concept of inheritance. 

Write down all the two-dimensional shapes you can think of (e.g. circle, rectangle, triangle, etc). Form these shapes into a hierarchy. Develop the graphic library using object-oriented concepts. Provide the following functions for manipulation of the shapes:

print()
Print the type and the associated information of the object on the screen. For example, if the object is a circle, you may print the coordinates of its center and its radius. 

area()
	Compute the area of the object

perimeter()
	Compute the perimeter of the object

Write a program to demonstrate the capability of your graphic library. Bonus will be given if you graphic library has additional interesting features.

In this assignment, you are required to submit a (hard-copy) report, which describes the design of this graphic library. The C++ source code should also be included. Furthermore, you have to do a demonstration of your program.

Question 2:  Due date for demo: week 13 for both groups. This is a firm deadline.
(The report and the program list can be submitted in week 14 on Monday in a mail Box that I will book later)  

Choice 1: 
Define a class called elevator that can show an elevator of 8 levels. Write a main function to show three elevators simultaneously. The main function is also responsible for deciding which elevator will stop at which level. (You have to think about the cases by yourself and write your own algorithms in the report. For example, a person has pressed the button to go down at level  3, and both elevator 1 and elevator 2  are going down at the same time. The  system should decide which elevator to stop at level 3.  For example, if elevator 1 stopped   three times before it reaches level 3 and elevator 2 never stops before it reaches level 3, then it is better to let  elevator 2 stop at level 3. ) A simple .exe program  (elevator.exe) is given  on my website as an example. You should design your own system and add more features to simulate an elevator system containing three elevators. Minimum requirements: (1)  Each level a  button indicating that the user outside the elevator wants to go down. (2)  Each elevator has 8 buttons to indicate which levels to stop. 

Choice 2: 

Write a program to do thing similar to the program air4 on my website. Bonus will be given to fancy   features.