how to lose your code with git checkout
This commit is contained in:
@@ -1,35 +1,6 @@
|
|||||||
package l2a.employees;
|
package l2a.employees;
|
||||||
|
|
||||||
public class Employee {
|
public record Employee(String ID, String name, String department, int salary, int bonus_salary) {
|
||||||
String ID;
|
|
||||||
String name;
|
|
||||||
String department;
|
|
||||||
int salary;
|
|
||||||
int bonus_salary;
|
|
||||||
|
|
||||||
public Employee (String ID, String name, String department, int salary, int bonus_salary) {
|
|
||||||
this.ID = ID;
|
|
||||||
this.name = name;
|
|
||||||
this.department = department;
|
|
||||||
this.salary = (salary);
|
|
||||||
this.bonus_salary = (bonus_salary);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getID() {
|
|
||||||
return ID;
|
|
||||||
}
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
public String getDepartment() {
|
|
||||||
return department;
|
|
||||||
}
|
|
||||||
public int getSalary() {
|
|
||||||
return salary;
|
|
||||||
}
|
|
||||||
public int getBonusSalary() {
|
|
||||||
return bonus_salary;
|
|
||||||
}
|
|
||||||
public String funny() {
|
public String funny() {
|
||||||
return ID + " " + name + " " + department + " " + salary + " " + bonus_salary;
|
return ID + " " + name + " " + department + " " + salary + " " + bonus_salary;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,10 +74,10 @@ public class EmployeeFileRead {
|
|||||||
int ind = 1;
|
int ind = 1;
|
||||||
for (Employee employee : employees) {
|
for (Employee employee : employees) {
|
||||||
System.out.println("\nEmployee " + ind++);
|
System.out.println("\nEmployee " + ind++);
|
||||||
System.out.println("ID: " +employee.getID());
|
System.out.println("ID: " +employee.ID());
|
||||||
System.out.println("Name: " +employee.getName());
|
System.out.println("Name: " +employee.name());
|
||||||
System.out.println("Department: " +employee.getDepartment() );
|
System.out.println("Department: " +employee.department() );
|
||||||
double inc = employee.getSalary() + employee.getBonusSalary() * 2.5;
|
double inc = employee.salary() + employee.bonus_salary() * 2.5;
|
||||||
System.out.println("Income: " + inc);
|
System.out.println("Income: " + inc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user