Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Lab 3 . Class and arrangements, Lab Reports of Object Oriented Programming

Finish the project and you'll crush your exam.

Typology: Lab Reports

2024/2025

Uploaded on 03/22/2025

vu-tuan-anh-1
vu-tuan-anh-1 🇻🇳

1 document

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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 abstract class with an abstract Draw method,
- MyBoundedShape is an abstract class with an abstract GetArea method,
- MyLine, MyOval, MyRectangle are concrete classes
In the main() method,
- Ask user to select 5 shapes and input their dimension
- Draw selected shapes
- 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)
pf2

Partial preview of the text

Download Lab 3 . Class and arrangements and more Lab Reports Object Oriented Programming in PDF only on Docsity!

Object-Oriented Programming Lab Session # 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 abstract class with an abstract Draw method,
      • MyBoundedShape is an abstract class with an abstract GetArea method,
      • MyLine, MyOval, MyRectangle are concrete classes In the main() method,
      • Ask user to select 5 shapes and input their dimension
      • Draw selected shapes
      • 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)
  1. Point2D and Point3D ( 25 points)