Worksheet 2.4 JAVA
Worksheet 2.4 JAVA
1. Add an Employee
2. Display All
3. Exit
If option 1 is selected, the application should gather details of the employee like
employee name, employee id, designation and salary and store it in a file.
If option 2 is selected, the application should display all the employee details.
3. Algorithm/pseudo code:
Step2: Declare 4 ArrayList to store employee name, empoyee id, designation and
salary.
Step4: Make a display function to Display the contents of each arraylist using a for
loop.
package com.chirag;
class Exp24
empName.add(name1);
eid.add(eid1);
designation.add(designation1);
salary.add(salary1);
while(true){
System.out.println("2. Display");
System.out.println("3. Exit");
switch(choices){
case 1:
emp.display();
continue; case 3:
return;
}
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
5. Result/Output/Writing Summary:
SCREENSHOT - 1
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
SCREENSHOT - 2