Question: Java programming problem; see the following images below for the code and problems. Requirements: Here, your colleague has decided that getName O, getIDO,and getTitle are
Java programming problem; see the following images below for the code and problems.



Requirements: Here, your colleague has decided that getName O, getIDO,and getTitle are methods that all subclasses would use, and so he has already implemented them. However, getweeklyPay and tostringO are more complex and the details of such behaviour are only known at the subclass level (as discussed below) While utilizing the provided Title enum, you task is to create two subclasses of Academic Student (Title title, int id, String name, double stipend) Staff(Title title, int id, String name) Super construction should be used where possible to reduce code redundancy You should take advantage of the already implemented methods in Academic when required tostring) should return a string representation of the object based on its class, id, and title; formatted as [class] id] (studies a) (works as a) [title] For example: Student 4 studies a Bachelor degree. Student 16 studies a Masters degree. Student 8 studies a PhD Staff 32 works as a tutor. Staff 64 works as a lecturer. To get the [title] component necessary for the string, you should inspect the tostringO method in the Title enum. getweek lyPayO is calculated based on the following information Students get paid a fixed weekly salary known as a stipend (see the Student constructor) Lecturers get paid an annual salary of $75,000 Tutors get paid an hourly rate of $35 Because tutors are paid hourly, you must implement an additional method public void setHours (int hours) in the Staff subclass that will allow administrators to set weekly hours for tutors You are encouraged to ask your tutor for refactoring tips. Finallv. upload and submit vour 4 classes: .Academic . Staff .Student . Title Academic.iava 1package oop.University: 3 public abstract class Academic ( private String name private int id; private Title title: public Academic (Title title, int id, String name) this.name- name this . id 1d; this.titletitle 10 12 13 14 15 16 17 18 19 20 21 public String getName ) return name public int getIDO return id; public Title getTitle) 23 2 4 25 26 27 28 29 return title public abstract double getweeklyPay O: public abstract String toString ) Title.java 1 package oop. University 3 public enum Title [ BACHELOR_STUDENT ("Bachelor degree.") MASTERS_STUDENT ("Masters degree.") PHD_STUDENT("PhD") TUTOR("tutor.") LECTURER ("lecturer."); 5 1.0 private final String text 12 1.3 14 1.5 16 17 1B 19 1 Title (String text) t this. text = text ; public String tostring) return text
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
