Question: i dont know if i am doing this right. or where to go from here. any help would be nice. here are the instructions: https://imgur.com/a/Rzzv2
i dont know if i am doing this right. or where to go from here. any help would be nice.
here are the instructions: https://imgur.com/a/Rzzv2
here is my code so far:
public class Teacher { private int numOf_UnreadEmails; private int theAge; private int numOf_Eccentricities; public Teacher(int emails, int age, int eccentricities) { eccentricities = 0; numOf_UnreadEmails = emails; theAge = age; numOf_Eccentricities = eccentricities; } public double stress(double stressLevel) { stressLevel = numOf_UnreadEmails; if (stressLevel <= 1000){ return stressLevel; } if (stressLevel >= 1000){ stressLevel = 1000; } return stressLevel; } public int respect(int respectLevel) { respectLevel = theAge - numOf_Eccentricities; return respectLevel; }
public class Professor extends Teacher{ public Professor(int emails,int age, int eccentricities){ super(numOf_UnreadEmails, theAge, numOf_Eccentricities); } public int respect(int respectLevel) { respectLevel = theAge + numOf_Eccentricities; //professors are age + eccentricities (overrides) return respectLevel; } public class Lecturer extends Teacher{ public Lecturer(int emails, int age, int eccentricities) { super(numOf_UnreadEmails, theAge, numOf_Eccentricities); } } public class gradStudent extends Teacher{ public gradStudent(int emails, int age, int eccentricities){ super(numOf_UnreadEmails, theAge, numOf_Eccentricities); } public double stress(double stressLevel) { //overrides superclass method stressLevel = numOf_UnreadEmails; if (stressLevel <= 1000){ return stressLevel*1.5; } if (stressLevel >= 1000){ stressLevel = 1000; } return stressLevel*1.5; } } public static void main(String[] args) { // TODO Auto-generated method stub
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
