0% found this document useful (0 votes)
3 views1 page

Java Assessment

The document outlines a design for an Employee Bonus Calculation System that incorporates object-oriented programming principles such as abstraction, encapsulation, and polymorphism. It specifies the creation of an abstract class 'Employee' with a private salary variable and an abstract method for bonus calculation, along with two subclasses for permanent and contract employees that implement different bonus calculations. The expected output includes sample bonus amounts for both types of employees.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Java Assessment

The document outlines a design for an Employee Bonus Calculation System that incorporates object-oriented programming principles such as abstraction, encapsulation, and polymorphism. It specifies the creation of an abstract class 'Employee' with a private salary variable and an abstract method for bonus calculation, along with two subclasses for permanent and contract employees that implement different bonus calculations. The expected output includes sample bonus amounts for both types of employees.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Scenario: Employee Bonus Calculation System

Problem Statement

Design a system to calculate bonuses for different types of employees in an organization.

Requirements

1. Use abstraction to define a common employee structure.


2. Use encapsulation to protect employee salary data.
3. Use polymorphism to calculate bonuses for different employee types using a
common reference.

Functional Details

 Create an abstract class Employee


o Private variable salary
o Abstract method calculateBonus()
 Create two subclasses:
o PermanentEmployee
o ContractEmployee
 Each subclass should calculate bonus differently
 Use runtime polymorphism in main()

Expected Output (Sample)


Permanent Employee Bonus: 20000.0
Contract Employee Bonus: 5000.0

You might also like