0% found this document useful (0 votes)
8 views3 pages

Rahul-JAVA Exp 1

The document outlines an experiment in a computer science course where students create a Java application to manage employee information using arrays. The application allows for Create, Read, Update, and Delete operations on employee data, and emphasizes structured data display for verification. The learning outcomes include hands-on experience with arrays, data management, and improved Java programming skills.

Uploaded by

vikas003thakur
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)
8 views3 pages

Rahul-JAVA Exp 1

The document outlines an experiment in a computer science course where students create a Java application to manage employee information using arrays. The application allows for Create, Read, Update, and Delete operations on employee data, and emphasizes structured data display for verification. The learning outcomes include hands-on experience with arrays, data management, and improved Java programming skills.

Uploaded by

vikas003thakur
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/ 3

DEPARTMENT OF

COMPUTER SCIENCE &


ENGINEERING
Experiment 1.1

Student Name: Vikas Thakur UID: 22BCS14542


Branch: BE CSE Section/Group: IoT-624-A
Semester: 6th Date of Performance:14/01/25
Subject Name: JAVA Subject Code: 22CSH-359

1. Aim:
Create an application to save the employee information using arrays in Java.

2. Objective:
• Implement an array to store employee information such as Employee ID, Name,
Designation, and Salary.
• Perform Create, Read, Update, and Delete operations on the employee data stored in
the array.
• Develop methods to access specific employee records and modify or delete them
based on user input.
• Display the stored employee data in a structured format to verify the correctness
of the operations.

3. Implementation/Code:

import java.util.Scanner;

class Employee {
String name;
int id;
String department;
Employee(String name, int id, String department) {
this.name = name;
this.id = id;
this.department = department;
}
}
public class EmployeeApp {
public static void main(String[] args) {
DEPARTMENT OF
COMPUTER SCIENCE &
ENGINEERING
Scanner scanner = new Scanner(System.in);
Employee[] employees = new Employee[5];
int count = 0;
while (count < 5) {
System.out.print("Enter employee name: ");
String name = scanner.nextLine();
System.out.print("Enter employee ID: ");
int id = scanner.nextInt();
scanner.nextLine();
System.out.print("Enter employee department: ");
String department = scanner.nextLine();
employees[count] = new Employee(name, id, department);
count++;
System.out.println("Do you want to enter more employees? (y/n)");
String choice = scanner.nextLine();
if (choice.equalsIgnoreCase("n")) {
break;
}
}

System.out.println("Employee Information:");
for (int i = 0; i < count; i++) {
System.out.println("Name: " + employees[i].name + ", ID: " + employees[i].id + ",
Department: " + employees[i].department);
}
}
}
4. Output:
DEPARTMENT OF
COMPUTER SCIENCE &
ENGINEERING

5. Learning Outcome

• Acquire hands-on experience in utilizing arrays to store and manage


multiple records of similar types.
• Understand how to systematically create, read, update, and delete data within
an application.
• Enhance logical thinking and problem-solving skills by designing a basic
system for managing employee data.
• Improve Java programming proficiency, including working with classes,
methods, loops, and custom functions.

You might also like