Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Code the Class structure described in the WLFU Problem. Specifically create the Abstract Class of
- Employees->The_WFLU_TEAM->RegionalCities(create only Boston here)->StaffCatagories(Admin, Docs, Nurses, MedSupport).
- Be sure to include variables for all data and all functions required by HR. Add any others you may need.
- Using the Class Structure, Create the following objects and store them in an array (call it BostEmp[]) for their regional hospital area Boston
- Name Staff type SSN Special Info Race
- IM Bones Doctor 455657890 100 AA
- UR Temp Adm Nurse 789302345 3 CA
- DVM Frakes Doctor 786456712 120 CA
- IM Boss Senior Exec 543126787 1 HS
- Using your array, BostEmp[], calculate the salary and the taxes for each individual. Sort them based on salary (smaller to larger) and print the sorted objects.
- Now develop a generic manager class for the HR system call it WLFUManager<T>. >. Your manager must store objects in an ArrayList and then sort them based on salary. It must have the following functions;
- int Add(T x) adds the object x to the stored list and returns the number of elements in the list.
- T Get(int x) get the object at position x from the list and returns it.
- Void Sort() sorts the stored ArrayList of objects (smaller to larger based on salary)
- With your generic manager do the following;
- Using the Add(T x) function, enter the employee objects created for the BostEmp[] array in Part 1 in the generic manager WLFUManager<T>.
- Using the Get function, Get(3) and print the element from the manager.
- Finally have the manager sort the objects. Print the objects.
- Then to prove that your manager is generic, create a new manager,
- Myints=new WLFUManager<Integer>
- and enter the following integers with Myints.Add(some value) and sort them, then print the sorted integers.
- 17
- 21
- -34
- 12
- 6
- 78
- Due Beginning of class 28 Feb.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement