Created
December 14, 2016 14:20
-
-
Save JonathanParser/8ea5e48f4b22ea14f891b35bc1ecf9be 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 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", "[email protected]", "89231233387", 10000,0); | |
a[1] = new Employee("Petrov Myrat", "Manager", "[email protected]", "89231244275", 20000,0); | |
a[2] = new Employee("Sidorov Roman", "BigBoss", "[email protected]", "89235531257", 130000,0); | |
a[3] = new Employee("Pupkin Feodor", "Engineer", "[email protected]", "89236661254", 10000,0); | |
a[4] = new Employee("Soriva Irina", "OficceManager", "[email protected]", "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