3 of 4
Paper No: 1
Enter id:1
Enter id:1
Enter name: Tran Anh
Enter name: Tran Anh
Enter salary:2000
Enter salary:2500
Enter seniority:6
Enter seniority: 11
1. Test setSeniority()
1. Test set Seniority()
2. Test updateSalary()
2. Test updateSalary()
Enter TC(1 or 2):2
Enter TC(1 or 2):2
OUTPUT:1, Tran Anh, 3000.00,6
Question 2:
OUTPUT:1, Tran Anh, 5000.00,11
Zoom
(3 marks)Write a class named Staff and a class named Engineer extended from Staff (i.e. Staff is a super class and Engineer is a subclass) with the following information:
Staff
Where:
-id: int
Staff()-default constructor
-salary: int
Staff (id:int, salary:int)-parameterized constructor which sets values to id and
+Staff()
salary
+Staff(id:int,salary:int)
+getld ():int
getId(): int-return id
Close
+ 100%