PRO192_-_PE03_-_FA_2024_3202.webp
Sơn Tùng1

PRO192_-_PE03_-_FA_2024_3202.webp

(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
-salary: int
+Staff()
+Staff(id:int,salary:int)
+getld ():int
+getSalary():int
+setSalary(salary: int):void
+toString():String
Staff()-default constructor
Staff (id:int, salary:int)-parameterized constructor which sets values to id and salary
getId(): int-return id
getSalary(): int-return salary
setSalary(salary: int): void update the salary. If the salary is less than 1000 then set it to 1000
toString(): String-return a string format of the Staff: id, salary
Engineer
-benefits: int
Where:
4 of 5
Paper No: 1
+ 100%
Zoom
Close

Thông tin

Category
PRO192
Thêm bởi
Sơn Tùng1
Ngày thêm
Lượt xem
3,841
Lượt bình luận
1
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRO192_-_PE03_-_FA_2024_3202.webp
File size
181.4 KB
Dimensions
1920px x 990px

Share this media

Back
Bên trên Bottom