Question
In a school, the Personnel Department is responsible for storing details about all staff who work for the school. There are four categories of staff:
In a school, the Personnel Department is responsible for storing details about all staff who work for the school. There are four categories of staff: management teacher support staff
maintenance and kitchen staff All staff have a StaffID and a Name. The Name has three parts: title (Mr/Mrs), first name and surname. In addition, the salary for each member of staff is stored.
A teacher has a classroom in which they do all their teaching. A teacher is also responsible for a form group. Support staff are either part-time or full-time.
They are also allocated to one academic department. ..........
Software, using object-oriented programming, is to be written to process data about the staff.
For this solution, details about maintenance and kitchen staff are not included.
Management are classified as staff but are not teachers or support staff or maintenance and kitchen staff. (a) Complete a class diagram showing the three classes: Staff Teacher
SupportStaff Include all the properties described above. In addition, include a constructor method that is called when an object of the class is created. The method should allow the object properties to be initialised. There should also be a show method that displays all the property
values
of the object.
(b) Implement the classes designed in
(a). Use inheritance to create appropriate relationships between the classes.
(c) Test the code by creating objects from each class and then displaying their property values.
(d) Create a new class,
Name, which has three properties:
Title, FirstName and Surname. Include a
method, DisplayName that has two parameters: 1 - Name displayed in the format: space
Name displayed in the format: