Skip to content

Instantly share code, notes, and snippets.

@JonathanParser
Created December 14, 2016 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonathanParser/4fb8296557ad3b0080fd50358e8a2bfa to your computer and use it in GitHub Desktop.
Save JonathanParser/4fb8296557ad3b0080fd50358e8a2bfa to your computer and use it in GitHub Desktop.
package JavaGeegbrain.Lesson4;
/**
* Created by Jack Sparrow on 14.12.2016.
*/
public class Main {
public static final int OT = 18; // Возрст от
public static final int DO = 70; // Возрст до
public static final int OTBOR = 40; // Критерии отбора
public static void main (String[] args){
Employee[] a = new Employee[5];
a[0] = new Employee("Ivanov Ivan", "Engineer", "Ivanov@mailbox.com", "89231233387", 10000,0);
a[1] = new Employee("Petrov Myrat", "Manager", "Petrov@mailbox.com", "89231244275", 20000,0);
a[2] = new Employee("Sidorov Roman", "BigBoss", "Sidorov@mailbox.com", "89235531257", 130000,0);
a[3] = new Employee("Pupkin Feodor", "Engineer", "Pupkin@mailbox.com", "89236661254", 10000,0);
a[4] = new Employee("Soriva Irina", "OficceManager", "Soriva@mailbox.com", "89276231235", 8000,0);
for (int i = 0; i <a.length ; i++) {
a[i].setAge(OT + (int) (Math.random() * (DO-OT))); // Генерируем и передаем через set новый возраст
if (a[i].getAge() >= OTBOR)
a[i].printInfo();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment