Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

Students also viewed these Databases questions

Question

8. What does a help desk do?

Answered: 1 week ago