Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions src/HW5/Employee.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package HW5;

public class Employee {
private String name;
private String position;
private String mail;
private String phone;
private Integer salary;
private Integer age;

public Employee(String name,String position,String mail,String phone,Integer salary,Integer age){
this.name = name;
this.position = position;
this.mail = mail;
this.phone = phone;
this.salary = salary;
this.age = age;
};

public Integer getSalary() {
return salary;
}

public String getMail() {
return mail;
}

public String getName() {
return name;
}

public String getPhone() {
return phone;
}

public String getPosition() {
return position;
}

public Integer getAge() {
return age;
}

@Override
public String toString() {
return "Employee{" +
"name='" + name + '\'' +
", position='" + position + '\'' +
", mail='" + mail + '\'' +
", phone='" + phone + '\'' +
", salary=" + salary +
", age=" + age +
'}';
}
}
16 changes: 15 additions & 1 deletion src/HW5/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
public class Main {

public static void main(String[] args) {
// write your code here
System.out.println("Hello");

Employee [] employee = new Employee[5];
employee[0] = new Employee("Ivan", "Dev.Team", "ivan@mail.dev.team.ru","8900123456",100000,30);
employee[1] = new Employee("Yuri", "Dev.Team", "yuri@mail.dev.team.ru","8900123457",100000,35);
employee[2] = new Employee("Stas", "Dev.Team", "stas@mail.dev.team.ru","8900123458",100000,40);
employee[3] = new Employee("Dima", "Dev.Team", "dima@mail.dev.team.ru","8900123459",100000,45);
employee[4] = new Employee("Vasia", "Dev.Team", "vasia@mail.dev.team.ru","8900123470",100000,50);

for (int i = 0; i < employee.length; i++){
if (employee[i].getAge() >= 40) {
System.out.println(employee[i].toString());
}
}

}
}