Skip to content

Object Oriented Programming Lab

SWE · Final · Spring 26

Paper 2 of 2By MAHMUDUL HASAN (2)Switch

Paper 2 of 2

This browser can’t show the PDF here

Open it, and your phone’s PDF viewer takes it, or download it.

Read the questions as text

Read off the PDF by AI, so it may have mistakes. The PDF is the original.

Question Write a Java program using two packages (domain and app) where in package domain you create an interface Payable with a method double calculatePayment(), and an abstract class Employee with fields id and name, a constructor to initialize them, and an abstract method display(); then create two subclasses FullTimeEmployee (with fixed salary) and PartTimeEmployee (with hourly rate and hours worked) that extend Employee and implement Payable, providing implementations for both calculatePayment() and display(); in package app, create a class TestApp with the main() method where you declare an ArrayList<Employee>, add at least 2 FullTimeEmployee and 2 PartTimeEmployee objects, and iterate through the list to call display() and calculatePayment().