Professional Documents
Culture Documents
Lab 3 - 24
Lab 3 - 24
Lab 3 - 24
Download given from CMS and changes the Project name &
folder with format: RollNumber, ex: HE171021. Use
Netbean open it then modify the project name to your
rollnumber like image above Code and run debug when finish u need zip
folder RollNumber and upload bellow to your class assignment! (1 point will be
deducted for each request if not fulfilled)
when finish u need zip folder RollNumber_Lab3 and upload bellow to your class
assignment!
1- Create an Employee Class with data: string (ID, Name, Address), Age int and
more Method get/set/toString/constructor … if needed
- Build a method to calculate employee salary with no parameters: formula for
calculating salary by 5000000+ (age – 20)*100000;
2- Create interface IWorker include 3 method as following:
3- Create class Worker inheritance class Employee and implements IWorker. add
the double Salary and int worker level data property to class Worker.
Implements f1: print all worker. Output show as:
OUTPUT:
(1, NVAn, hanoi, 21, 2, 5100000.0)
(2, LHHung, hochiminh, 25, 3, 5500000.0)
(3, HAThu, namdinh, 37, 4, 6700000.0)
(4, HTNghia, bacgiang, 41, 5, 7100000.0)
(5, LDTho, hanoi, 55, 6, 8500000.0)
(6, NDVinh, hoabinh, 28, 1, 5800000.0)
6
Implements f2: recalculate salary in which if the address with hanoi or hochiminh
the allowance will be increased by 500,000 VND and Display a list with workers
with added priority by 500000vnd first.
OUTPUT:
(1, NVAn, hanoi, 21, 2, 5600000.0)
(2, LHHung, hochiminh, 25, 3, 6000000.0)
(5, LDTho, hanoi, 55, 6, 9000000.0)
(3, HAThu, namdinh, 37, 4, 6700000.0)
(4, HTNghia, bacgiang, 41, 5, 7100000.0)
(6, NDVinh, hoabinh, 28, 1, 5800000.0)