I was fiddling with it more last night, after my post. When I changed the scannerIn.nextline() to just scannerIn.next() the program was stopping to accept input. Does that work as well? On this assignment, we are not looking at the vector, only the grand total of the calcWeeklyPay() method. So my new code looks like this:
else if (index == 1)
{
System.out.println("Enter the employee's ID: ");
int eId = scannerIn.nextInt();
System.out.println("Enter the employee's first name: ");
String fName = scannerIn.next();
System.out.println("Enter the employee's last name: ");
String lName = scannerIn.next();
System.out.println("Enter the employee's year end bonus: ");
double yEndBon = scannerIn.nextDouble();
System.out.println("Enter the employee's yearly executive bonus: ");
double yExBon = scannerIn.nextDouble();
ExecutiveEmployee temp = new ExecutiveEmployee(eId, fName, lName, 40, 60000.00, yEndBon, yExBon);
emp.add(temp);
count++;
}
If that doesn't work (for some reason), and I understand you right, is this how my code should look instead?
else if (index == 1)
{
System.out.println("Enter the employee's ID: ");
int eId = scannerIn.nextInt();
scannerIn.nextLine();
System.out.println("Enter the employee's first name: ");
String fName = scannerIn.nextLine();
System.out.println("Enter the employee's last name: ");
String lName = scannerIn.nextLine();
System.out.println("Enter the employee's year end bonus: ");
double yEndBon = scannerIn.nextDouble();
System.out.println("Enter the employee's yearly executive bonus: ");
double yExBon = scannerIn.nextDouble();
ExecutiveEmployee temp = new ExecutiveEmployee(eId, fName, lName, 40, 60000.00, yEndBon, yExBon);
emp.add(temp);
count++;
}