I'm creating a DataBase for looking up employee's different stats in a company.
Is there any way I can make this more compact/efficient?
/**
* Write a description of class DataBase here.
*
* @author (name)
* @version (date)
*/
import java.util.Scanner;
import java.util.Arrays;
public class DataBase {
public static void main(String args[]) {
System.out.println('\u000C');
int y = 1;
while (y == 1) {
System.out.println("Enter employee name from list: ");
System.out.println("\n");
String[] employee = new String[3];
employee[0] = "Dave Johnson";
employee[1] = "Hugh Man";
employee[2] = "Ethan Isakson";
System.out.println(Arrays.toString(employee));
Scanner sc = new Scanner(System.in);
String input = sc.nextLine();
String [] Inquiry = new String[4];
Inquiry[0] = "Job";
Inquiry[1] = "Salary";
Inquiry[2] = "Employed";
Inquiry[3] = "All";
if (input.equals(employee[0])) {
System.out.println("Type inquiry from list: ");
System.out.println("\n");
System.out.println(Arrays.toString(Inquiry));
Scanner dave = new Scanner(System.in);
String input2 = dave.nextLine();
String [] Dave = new String[3];
Dave[0] = "Technician";
Dave[1] = "$87,000";
Dave[2] = "3 Years";
if (input2.equalsIgnoreCase("Job")) {
System.out.println("\n");
System.out.println(Dave[0]);
System.out.println("\n");
} else if (input2.equalsIgnoreCase("Salary")) {
System.out.println("\n");
System.out.println(Dave[1]);
System.out.println("\n");
} else if (input2.equalsIgnoreCase("Employed")) {
System.out.println("\n");
System.out.println(Dave[2]);
System.out.println("\n");
} else if (input2.equalsIgnoreCase("All")) {
System.out.println("\n");
System.out.println(Arrays.toString(Dave));
System.out.println("\n");
} else {
System.out.println("Enter A Valid Inquiry");
continue;
}
}
if (input.equals(employee[1])) {
System.out.println("Type inquiry from list: ");
System.out.println("\n");
System.out.println(Arrays.toString(Inquiry));
Scanner hugh = new Scanner(System.in);
String input3 = hugh.nextLine();
String [] Hugh = new String[3];
Hugh[0] = "Stock Broker";
Hugh[1] = "$135,000";
Hugh[2] = "7 Years";
if (input3.equalsIgnoreCase("Job")) {
System.out.println("\n");
System.out.println(Hugh[0]);
System.out.println("\n");
} else if (input3.equalsIgnoreCase("Salary")) {
System.out.println("\n");
System.out.println(Hugh[1]);
System.out.println("\n");
} else if (input3.equalsIgnoreCase("Employed")) {
System.out.println("\n");
System.out.println(Hugh[2]);
System.out.println("\n");
} else if (input3.equalsIgnoreCase("All")) {
System.out.println("\n");
System.out.println(Arrays.toString(Hugh));
System.out.println("\n");
} else {
System.out.println("Enter A Valid Inquiry");
continue;
}
}
if (input.equals(employee[2])) {
System.out.println("Type inquiry from list: ");
System.out.println("\n");
System.out.println(Arrays.toString(Inquiry));
Scanner ethan = new Scanner(System.in);
String input4 = ethan.nextLine();
String [] Ethan = new String[3];
Ethan[0] = "Janitor";
Ethan[1] = "$67,000";
Ethan[2] = "15 Years";
if (input4.equalsIgnoreCase("Job")) {
System.out.println("\n");
System.out.println(Ethan[0]);
System.out.println("\n");
} else if (input4.equalsIgnoreCase("Salary")) {
System.out.println("\n");
System.out.println(Ethan[1]);
System.out.println("\n");
} else if (input4.equalsIgnoreCase("Employed")) {
System.out.println("\n");
System.out.println(Ethan[2]);
System.out.println("\n");
} else if (input4.equalsIgnoreCase("All")) {
System.out.println("\n");
System.out.println(Arrays.toString(Ethan));
System.out.println("\n");
} else {
System.out.println("Enter A Valid Inquiry");
continue;
}
}
System.out.println("Any other Inquiries? Y or N");
Scanner last = new Scanner(System.in);
String resp = last.nextLine();
if (resp.equals("Y")) {
continue;
} else if (resp.equals("N")) {
System.exit(0);
} else {
System.out.println("Enter A Valid Inquiry");
continue;
}
}
}
}