Object-Oriented Programming Lab Session #3 I. References

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Object-Oriented Programming

Lab Session #3

I. References
- Oracle Java Documentation: https://docs.oracle.com/javase/tutorial/java/IandI/index.html
- Inheritance in Java Tutorial: https://www.tutorialspoint.com/java/java_inheritance.htm

II. Exercises
You are required to implement the following design as well as a main() method in a another class
to test your implementation:

1. Shapes (25 points)


Implement the hierarchy below where
- MyShape is an class with a Draw method that does nothing,
- MyBoundedShape is a class with a GetArea method that does nothing,
- MyLine, MyOval, MyRectangle are classes

In the main() method,


- Ask user to select 5 shapes and input their dimension
- Draw selected shapes (Skip to drawing of the class MyOval)
- Compute and show area of selected shapes if they are a bounded shape

2. Triangle and Point (25 points)

3. Person, Student & Staff (25 points)


4. Point2D and Point3D (25 points)

You might also like