You are on page 1of 1

Object Oriented Programming May 25, 2022

Quiz 04 - Theory
Time Allowed: 20 Minutes Total Marks: 10
Name: ID #:

Q.1 Write a Java program as per following specifications:


1. Create a base class (Shape), and derived classes (Circle and Square). [3 marks]
2. Add an abstract area function in base class while implementing it separately in
derived classes (Area of Circle: 3.14*r*r; Area of Square : WxW) [4 marks]
3. Display the output area of each derived class’s instance using Polymorphism [3
marks]

You might also like