seniority: int
+Employee ()
+Employee (id: int, name: String, salary:
double, seniority: int)
+setSeniority(int seniority): void
+toString(): String
+updateSalary(): void
constructor, which sets values to id, name,salary, and seniority
setSeniority(int seniority): void update seniority. If the seniority less than or equal to 0 then set to 1
toString(): String return string of format of the Employee: id, name, salary, seniority. The salary is formatted two decimal places.
updateSalary(): void update salary by the
following rules:
seniority from 3 to 5: increase salary up to 30%
seniority from 6 to 10: increase salary up to 50%
seniority greater than 10: increase salary up to 100%
-The Main class is provided for you in binary form. You only test your program by running the binary file. There are several test cases for you, as follows:
Enter id:1
Enter id:1
Enter name: Tran Anh
Enter name: Tran Anh
Enter salary: 1000
Enter salary: 1000
Enter seniority:2
Enter seniority:4
1. Test setSeniority()
1. Test setSeniority()
2. Test updateSalary()
2. Test updateSalary()
Enter TC(1 or 2):1
Enter TC(1 or 2):2
Zoom
Close
+ 100%