0% found this document useful (0 votes)
56 views4 pages

PBLJ 1.1

The document describes a Java application to save employee information using arrays. It includes the student details, aim of the program, software requirements, source code, and expected input/output. The source code defines arrays to store employee numbers, names, join dates, department codes, designations, salaries and other details. It searches for an employee number in the array and prints their information.

Uploaded by

Abhishek Pundir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views4 pages

PBLJ 1.1

The document describes a Java application to save employee information using arrays. It includes the student details, aim of the program, software requirements, source code, and expected input/output. The source code defines arrays to store employee numbers, names, join dates, department codes, designations, salaries and other details. It searches for an employee number in the array and prints their information.

Uploaded by

Abhishek Pundir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

1

ExperimentNo :-1

Student Name: Ankit Jha UID: 20BCS9637


Branch: BE-CSE Section/Group: 705/A
Semester: 5th Subject: JAVA Lab

Aim :-Create a application to save the employee information using arrays.

S/W Requirement:-Eclipse_IDE - (Java),Netbean..


Source Code :-

package Exp;

publicclassArremp {

publicstaticvoidmain(String[] args) {

intempno[] = {1001,1002,1003,1004,1005,1006,1007};

String name[]={"Ashish","Sushma","Rahul","Chahat","Ranjan","Suman","Tanmay"};

StringJoinDate[]={"01/04/2009","23/08/2012","12/11/2008","29/01/2013","16/07/2005","1/1
/2000","12/06/2006"};

chard_code [] = {'e','c','k','r','m','e','c'};

String dept[]={"R&D","PM","Acct","front","Desk","Engg","Manufacturing","PM"};

intbasic [] = {20000,30000,10000,12000,50000,23000,29000};
inthra [] = {8000,12000,8000,6000,20000,9000,12000};
intit [] = {3000,9000,1000,2000,20000,4400,10000};
String designation = null;
intda=0;
intsalary = 0;
intindex = -1;
intemp= Integer.parseInt(args[0]);

for(inti=0;i<empno.length;i++)
{
if (empno[i]==emp)

20BCS9637_ANKIT JHA_20BCS_WM-705-A
2

{
index=i;
}
}
if (index==-1)
{
System.out.println("There is no such employee." +emp);
}

else
{

charcode;

code=d_code[index];

switch(code)
{
case'e':
designation="Engineer";
da=20000;
break;
case'c':
designation="Consultant";
da=32000;
break;
case'k':
designation="Clerk";
da=12000;
break;
case'r':
designation="Receptonist";
da=15000;
break;
case'm':
designation="Manager";
da=40000;
break;
default:
designation="Invalid";
da=0;
}
salary=basic[index]+ hra[index]+da-it[index];
System.out.println("Emp No" +" "+"Emp Name" +" "+"Department"+"
"+"Designation"+" "+"Salary");

System.out.println(empno[index]+" "+name[index]+" "+dept[index] +"


"+designation +" "+salary);

20BCS9637_ANKIT JHA_20BCS_WM-705-A
3

Input :-

Output :-

20BCS9637_ANKIT JHA_20BCS_WM-705-A
4

20BCS9637_ANKIT JHA_20BCS_WM-705-A

You might also like