0% found this document useful (0 votes)
2 views

.java file (employee names)

The document is a Java program that stores information about five employees, including their names, addresses, and emails. It prompts the user to enter an index to retrieve and display the corresponding employee's information. If the input index is invalid, it notifies the user of the error.

Uploaded by

vallejoshanna97
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)
2 views

.java file (employee names)

The document is a Java program that stores information about five employees, including their names, addresses, and emails. It prompts the user to enter an index to retrieve and display the corresponding employee's information. If the input index is invalid, it notifies the user of the error.

Uploaded by

vallejoshanna97
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/ 2

Import java.util.

Scanner;

Public class Main {

Public static void main(String[] args) {

String[] empName = new String[5];

String[] empAddress= new String[5];

String[] empEmail = new String[5];

empName[0] = “Ashanti Maximillian”;

empAddress[0] = “Brgy. Suguit, Maria Aurora, Aurora”;

empEmail[0] = [email protected];

empName[1] = “Kean Mozort”;

empAddress[1] = “Brgy. Diaat, Marian Aurora, Aurora”;

empEmail[1] = [email protected];

empName[2]= “Malia Santos”;

empAddress[2] = “St. Tomas, Maria Aurora, Aurora”;

empEmail[2] = [email protected];

empName[3]= “Haraniah Delaverde”;

empAddress[3] = “St. Lucia, Maria Aurora, Aurora”;

empEmail[3] = [email protected];

empName[4]= “Agus Cupido”;

empAddress[4] = “Brgy. Dikildit, Maria Aurora, Aurofa”;


empEmail[4] = [email protected];

Scanner scanner = new Scanner(System.in);

System.out.println(“Enter the employee index (0-4): “);

Int empIndex = scanner.nextInt();

If (empIndex >= 0 && empIndex < 5) {

System.out.println(“Employee Information:”);

System.out.println(“Name: “ + empName[empIndex]);

System.out.println(“Address: “ + empAddress[empIndex]);

System.out.println(“Email: “ + empEmail[empIndex]);

} else {

System.out.println(“Invalid employee index.”);

You might also like