I'm a tad bit confused by the monster assignment I got for my java class. The assignment is to create 6 classes: Employee (abstract class inherits Object), [HourlyEmployee, SalaryEmployee, CommissionEmployee] all inherit from Employee, EmployeeManager, and EmployeeDriver (contains the main method and menu system).
Unfortunately, my Java 1 teacher didn't teach us all she was supposed to, and as a result I'm struggling a bit to understand some of the concepts that my current teacher is mentioning that we should have already learned in Java 1. Included in these misunderstood topics are: common classes in Object such as toString and equals, bubble sort, and most of object-oriented programming. So a few questions I have:
1. How to I implement the toString methods of each employee class from the driver where the information is prompted?
2. the prompts for first name, last name, middle initial, gender, employee number, and fulltime in the driver are
which was given to me by the instructor. These variables are different than the protected variables listed in the UML diagram for Employee, do I need to set the variables equal to to these shortened versions in Employee's constructor? ie.
and is that even legal to do since some of the data members are chars?
I might have more questions later as I haven't even started on the manager class yet.
Thanks in advance for any help.
Unfortunately, my Java 1 teacher didn't teach us all she was supposed to, and as a result I'm struggling a bit to understand some of the concepts that my current teacher is mentioning that we should have already learned in Java 1. Included in these misunderstood topics are: common classes in Object such as toString and equals, bubble sort, and most of object-oriented programming. So a few questions I have:
1. How to I implement the toString methods of each employee class from the driver where the information is prompted?
2. the prompts for first name, last name, middle initial, gender, employee number, and fulltime in the driver are
Code:
System.out.print("Enter Last Name: ");
ln = in.next();
System.out.print("Enter First Name: ");
fn = in.next();
System.out.print("Enter Middle Initial: ");
mi = in.next().charAt(0);
System.out.print("Enter Gender: ");
g = in.next().charAt(0);
System.out.print("Enter Employee Number: ");
en = in.nextInt();
System.out.print("Full Time? (y/n): ");
f = in.next().charAt(0);
Code:
lastName = ln; firstName = fn; middleInitial = mi; gender = g; employeeNumber = en; fulltime = f;
I might have more questions later as I haven't even started on the manager class yet.
Thanks in advance for any help.











Comment