Question
I need help with completely this program. I am not sure how to go from here. Instructions: https://imgur.com/a/YAc1B my code so far: import java.util.Random; public
I need help with completely this program. I am not sure how to go from here.
Instructions: https://imgur.com/a/YAc1B
my code so far:
import java.util.Random;
public class Teacher { private int numOf_UnreadEmails; private int theAge; private int numOf_Eccentricities; public Teacher() { //def constructor numOf_Eccentricities = 0; numOf_UnreadEmails = 0; theAge = 0; } public Teacher(int emails, int age, int eccentricities) { //arg constructor 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 double respect(double respectLevel) { respectLevel = theAge - numOf_Eccentricities; return respectLevel; } public void receiveMail(int newMail) { double stressLevel = 0; double respectLevel = 0; numOf_UnreadEmails += newMail; //First double randomVar = Math.random(); double randomVar2 = Math.random(); if (randomVar <= .20){ if (randomVar2 <= .50) { numOf_Eccentricities += 2; } else if(randomVar2 > .50) { numOf_Eccentricities -= 2; } } if(stress(stressLevel) > respect(respectLevel)){ //got stuck here } }
public class Professor extends Teacher{ public Professor(int emails,int age, int eccentricities){ super(numOf_UnreadEmails, theAge, numOf_Eccentricities); } public int respect(int respectLevel) { //overrides super class respect method respectLevel = theAge + numOf_Eccentricities; 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started