Java Program: Public Class Employee (Int Eid String Ename
Java Program: Public Class Employee (Int Eid String Ename
OTP number based on the user request. The code prompts the
user to input user id and time in sec. If the request is within 60sec
the code should generate same OTP. If the request is after 60sec a
new OTP has to be generated.
1<ID<10 – User Id
OUTPUT
3 Jay 658
1 RAJ 567
Now write code that prompts the user to enter the Employee details like id, name, and prompt
Department details like department id, name and designation details in ArrayList<Employee>
object. Enter at least 3 employees and department info print those details to the output by iterating
through Department ArrayList. Another important thing is that the property Department in Employee
class should be of type Department (which is a class).
int eid;
String ename;
Department department;
this.eid = eid;
this.ename = ename;
this.department = department;
}
}
int did;
String dname;
String designation;
this.did = did;
this.dname = dname;
this.designation = designation;
}
}
import java.util.ArrayList;
import java.util.Scanner;
1D Array
import java.util.*;
if (i < 0 || game[i] == 1)
return false;
return true;
game[i] = 1;
|| canWin(leap, game, i + 1)
int q = scan.nextInt();
while (q-- > 0) {
int n = scan.nextInt();
game[i] = scan.nextInt();
scan.close();
String arr[]={"1005"};
int DA=0,Basic=0,HRA=0,IT=0;
String desig="",Name="",dept="";
String ch="";
String salaryDetails[][]={{"e","Engineer","20000"},
{"c","Consultant","32000"},
{"k","Clerk","12000"},
{"r","Reception","15000"},
{"m","manager","40000"}
};
};
for(int i=0;i<6;i++)
if (arr[0]==employeeDetails[i][0])
Name = employeeDetails[i][1];
ch= employeeDetails[i][3];
dept= employeeDetails[i][4];
Basic=Integer.parseInt(employeeDetails[i][5]);
HRA=Integer.parseInt(employeeDetails[i][6]);
IT=Integer.parseInt(employeeDetails[i][7]);
switch(ch)
DA = Integer.parseInt(salaryDetails[0][2]);
// System.out.println(desig+DA);
break;
DA = Integer.parseInt(salaryDetails[1][2]);
// System.out.println(desig+DA);
break;
DA = Integer.parseInt(salaryDetails[2][2]);
// System.out.println(desig+DA);
break;
DA = Integer.parseInt(salaryDetails[3][2]);
// System.out.println(desig+DA);
break;
DA = Integer.parseInt(salaryDetails[4][2]);
// System.out.println(desig+DA);
break;
int Salary=Basic+HRA+DA-IT;
int arr[]={5,3,6,7,8,10,2,4,1};
int great=0;
System.out.print(arr[count]+" ");
if(arr[count]>great)
great=arr[count];
count++;
System.out.println();