hi i need help!!!!
i am writing a program that has a class Employee that is derived from a class Person.....i have another class EmployeeData and in this class:
1. has one array of max 20 elements.
Each element is an object of type Employee. This class
should have methods for adding an employee, deleting
an employee and modifying an employee.
so far i have:
public class EmployeeData
{
Employee[][][][] a = new Employee[20][20][20][20];
public void add()
{
System.out.println("Enter new employee socialnumber. [Example: 123456789]"
System.out.println("Enter new employee name:"
System.out.println("Enter new employee salary. Integer value only please. No decimals!!!"
System.out.println("Enter new employee email address:"
int i;
for(i = 0; i < a.length; i++)
{
a = SavitchIn.readLineEmployee();
}
}
public void delete()
{
System.out,println("Enter the employees social security number of that employee you want to delete"
String ans = SavitchIn.readLineNonwhiteChar();
int i;
for(i = 0; i < a.length; --i)
{
if(ssNum == ans)
{
System.out.println("Deleting: " + ssNum + " data"
i only have that much for deleting......i am stuck..please help how would i delete....the user would enter the ss number of the employee they want deleted and then it would search and find the array of that employee and delete it and move everything else up one index. how can i do that?????
please help me asap!!!!
thank-you so much.
i am writing a program that has a class Employee that is derived from a class Person.....i have another class EmployeeData and in this class:
1. has one array of max 20 elements.
Each element is an object of type Employee. This class
should have methods for adding an employee, deleting
an employee and modifying an employee.
so far i have:
public class EmployeeData
{
Employee[][][][] a = new Employee[20][20][20][20];
public void add()
{
System.out.println("Enter new employee socialnumber. [Example: 123456789]"
System.out.println("Enter new employee name:"
System.out.println("Enter new employee salary. Integer value only please. No decimals!!!"
System.out.println("Enter new employee email address:"
int i;
for(i = 0; i < a.length; i++)
{
a = SavitchIn.readLineEmployee();
}
}
public void delete()
{
System.out,println("Enter the employees social security number of that employee you want to delete"
String ans = SavitchIn.readLineNonwhiteChar();
int i;
for(i = 0; i < a.length; --i)
{
if(ssNum == ans)
{
System.out.println("Deleting: " + ssNum + " data"
i only have that much for deleting......i am stuck..please help how would i delete....the user would enter the ss number of the employee they want deleted and then it would search and find the array of that employee and delete it and move everything else up one index. how can i do that?????
please help me asap!!!!
thank-you so much.