Lab Guides: Java SE 8 Programming Language
Lab Guides: Java SE 8 Programming Language
Lab G ui des
Contents
Unit 5: Basic OOP............................................................................................................................ 2
Lab Guide 1: Abstract class, Inheritance, Polymorphism..............................................................2
Objectives: JPL-9......................................................................................................................... 2
Lab Guides Mr Tuan Cat
CODE: JPL.M.L005
TYPE: Medium
LOC:
DURATION: 90 MINUTES
Objectives:
Able to create Java-based applications that take advantage of Java object-oriented features, including
encapsulation, inheritance, and polymorphism.
Understand the static components in java
Problem Descriptions:
Create a new package named lab5.
Create an abstract class Employee with: employee name, date of birth, address, company name,
calcSalary() abstract method, inputData() method to input employee information, display() method
to show all information. This class contains constructor and getter/setter if needs.
There are three employee type:
o Production staff: amount of product, salary = amount of product * 20$;
Create class ProductionStaff, DailyStaff and Manager that extends Employee class. Override
calcSalary to calculate salary for each employee type.
Create another class named EmployeeManagement that creates an array contains 3 employees of
above type, loop to calls the display() method to print the outputs.
Screen Designs:
Screen 1: input data Screen 2: display data
Employee class
DailyStaff class
ProductionStaff class:
Manager class:
EmployeeManagement class
-- THE END -