Advertisement
Luninariel

WLFU - Instructions

Feb 23rd, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. Code the Class structure described in the WLFU Problem. Specifically create the Abstract Class of
  2. Employees->The_WFLU_TEAM->RegionalCities(create only Boston here)->StaffCatagories(Admin, Docs, Nurses, MedSupport).
  3. Be sure to include variables for all data and all functions required by HR. Add any others you may need.
  4. Using the Class Structure, Create the following objects and store them in an array (call it BostEmp[]) for their regional hospital area Boston
  5.  
  6. Name Staff type SSN Special Info Race
  7. IM Bones Doctor 455657890 100 AA
  8. UR Temp Adm Nurse 789302345 3 CA
  9. DVM Frakes Doctor 786456712 120 CA
  10. IM Boss Senior Exec 543126787 1 HS
  11.  
  12. 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.
  13. 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;
  14. int Add(T x) adds the object x to the stored list and returns the number of elements in the list.
  15. T Get(int x) get the object at position x from the list and returns it.
  16. Void Sort() sorts the stored ArrayList of objects (smaller to larger based on salary)
  17. With your generic manager do the following;
  18. Using the Add(T x) function, enter the employee objects created for the BostEmp[] array in Part 1 in the generic manager WLFUManager<T>.
  19. Using the Get function, Get(3) and print the element from the manager.
  20. Finally have the manager sort the objects. Print the objects.
  21. Then to prove that your manager is generic, create a new manager,
  22. Myints=new WLFUManager<Integer>
  23. and enter the following integers with Myints.Add(some value) and sort them, then print the sorted integers.
  24. 17
  25. 21
  26. -34
  27. 12
  28. 6
  29. 78
  30. Due Beginning of class 28 Feb.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement