Created
December 14, 2016 11:19
-
-
Save JonathanParser/1273f63d37670bb4371b02daebad4d04 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package JavaGeegbrain.Lesson4; | |
/** | |
* Created by Jack Sparrow on 14.12.2016. | |
*/ | |
public class Employee { | |
private String name; // Полное имя сотрудника в формате | |
private String function; // Должность | |
private String email; // Email сотрудника | |
private String phone; //Номер телефона | |
private int pay; //Зарплата | |
private int age; //Возраст | |
public Employee (String fullname,String function,String email,String phone,int pay, int age) { | |
this.name = fullname; | |
this.function = function; | |
this.email = email; | |
this.phone = phone; | |
this.pay = pay; | |
this.age = age; | |
} | |
public String getName() { | |
return name; | |
} | |
public String getFunction() { | |
return function; | |
} | |
public String getEmail() { | |
return email; | |
} | |
public String getPhone() { | |
return phone; | |
} | |
public int getPay() { | |
return pay; | |
} | |
public int getAge() { | |
return age; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
public void setFunction(String function) { | |
this.function = function; | |
} | |
public void setEmail(String email) { | |
this.email = email; | |
} | |
public void setPhone(String phone) { | |
this.phone = phone; | |
} | |
public void setPay(int pay) { | |
this.pay = pay; | |
} | |
public void setAge(int age) { | |
if (age < 18 || age > 99) { | |
System.out.println("У сотрудника "+name+" введен не корректный возраст!"); | |
return; | |
} | |
this.age = age; | |
} | |
public void printInfo(){ | |
System.out.println("ФИО: "+name+" Возраст:"+age+" Должность: "+function+" Email: "+email+" Номер телефона: "+phone+" Зарплата: "+pay+"$"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment