I am trying to write a program that has to retrieve a list of employees that is stored in an Array. my code looks like this;
package Assignment2;
import java.util.Scanner;
public class employeeTest {
public static void main(String []args)
{ Scanner in = new Scanner(System.in);
int menuSel;
System.out.println("Menu");
System.out.println("1. Display all staff");
System.out.println("2. Clear Schedule");
System.out.println("3. Display Schedule");
System.out.println("4. Assign shifts to casual employees");
System.out.println("5. Assign shifts to permanent employees");
System.out.println("6. Calculate total weekly wages");
System.out.println("7. Exit program");
menuSel = in.nextInt();
switch(menuSel){
case 1:
}
}
public static void employeeList(Employeeclass _list[])
{//this is the array that stores the employees
_list[0] = new permanentEmployee("Joshua", "Power", "POW30310713", 5, 812.47);
_list[1] = new casualEmployee("Joshua", "Power", "POW12345678", 5, 812.47, 56.00);
_list[2] = new casualEmployee("Robyn", "Power", "ROB12345678", 3, 5.0, 00.00);
_list[3] = new permanentEmployee("Joshua", "Power", "POW12345678", 5, 812.47);
_list[4] = new permanentEmployee("Joshua", "Power", "POW12345678", 5, 812.47);
_list[5] = new casualEmployee("Robyn", "Power", "ROB12345678", 3, 5.0, 00.00);
_list[6] = new casualEmployee("Joshua", "Power", "POW12345678", 5, 812.47, 23.0);
_list[7] = new casualEmployee("Robyn", "Power", "ROB12345678", 3, 5.0, 00.00);
_list[8] = new casualEmployee("Robyn", "Power", "ROB12345678", 3, 5.0, 00.00);
_list[9] = new casualEmployee("Robyn", "Power", "ROB12345678", 3, 5.0, 00.00);
}
public static void listEmployees(Employeeclass _list[])
{
for (int i=0; i<_list.length; i++)
System.out.println(_list[i].toString());
}
{
Employeeclass list[] = new Employeeclass[10];
employeeList(list);
listEmployees(list);
}
}