|
| 1 | +import java.util.Random; |
| 2 | +import java.util.Scanner; |
| 3 | + |
| 4 | +public class Employee |
| 5 | +{ |
| 6 | + public static void main(String[] args) |
| 7 | + { |
| 8 | + int birthyear=1992; |
| 9 | + boolean isUnionMember= true; |
| 10 | + String fristname="Avi"; |
| 11 | + String Lastname="Garud"; |
| 12 | + String middlename="Vishwanath"; |
| 13 | + int employeeNumber ; |
| 14 | + Scanner scanner=new Scanner(System.in); |
| 15 | + printHeader(); |
| 16 | + System.out.println("Please enter your 5 digit employee number "); |
| 17 | + employeeNumber=scanner.nextInt(); |
| 18 | + printFullName(fristname,Lastname,middlename); |
| 19 | + printUnionStatus(isUnionMember); |
| 20 | + printAge(birthyear); |
| 21 | + printEvenOrOdd(employeeNumber); |
| 22 | + printGeneratedScreatPassword(employeeNumber); |
| 23 | + } |
| 24 | + public static void printHeader() |
| 25 | + { |
| 26 | + System.out.println("Welcome to the wallabutech Employee Application"); |
| 27 | + System.out.println("==============================================="); |
| 28 | + } |
| 29 | + public static void printFullName(String fristname,String Lastname,String middlename) |
| 30 | + { |
| 31 | + System.out.println(Lastname+","+fristname+" "+middlename); |
| 32 | + } |
| 33 | + public static void printUnionStatus(boolean isUnioMember) |
| 34 | + { |
| 35 | + System.out.println("Your Union statues :"+isUnioMember); |
| 36 | + } |
| 37 | + public static void printAge(int birthyear) |
| 38 | + { |
| 39 | + int age=2018-birthyear; |
| 40 | + System.out.println("Your Agr is :"+age); |
| 41 | + } |
| 42 | + public static void printEvenOrOdd( int employeeNumber ) |
| 43 | + { |
| 44 | + |
| 45 | + System.out.println("Employee number is even /odd(1=odd,0=even:"+employeeNumber%2); |
| 46 | + } |
| 47 | + public static void printGeneratedScreatPassword(int employeeNumber) |
| 48 | + { |
| 49 | + Random random=new Random(); |
| 50 | + int number =random.nextInt(10)+1; |
| 51 | + |
| 52 | + int password=(employeeNumber+number)*5; |
| 53 | + System.out.println("Employee's random secreat pw is:"+password); |
| 54 | + |
| 55 | + |
| 56 | + } |
| 57 | +} |
0 commit comments