Question: Write a Job interface, that includes some of the important parts of a Job: public boolean hired() public boolean fired() public double getPay() public boolean

Write a Job interface, that includes some of the important parts of a Job:

  • public boolean hired()
  • public boolean fired()
  • public double getPay()
  • public boolean raise(double value)
  • public void setWorkHours(int startHour, int startMinute, int endHour, int endMinute)
  • public boolean goToMeetings()
  • public void readEmail()
  • public boolean annoyingBoss()

Part 2

Write the RetailWorker that implements the interface like so:

  • public boolean hired()
    • should change the employed instance variable to be true
  • public boolean fired()
    • should change the employed instance variable to be false, or print a warning message if they are already fired.
  • public double getPay()
    • returns the pay of the RetailWorker
  • public boolean raise(double value)
    • Raise the pay instance variable by the amount stated
  • public void setWorkHours(int startHour, int startMinute, int endHour, int endMinute)
    • sets the start/end hours and minutes to the input times
  • public boolean goToMeetings()
    • return true if inMeeting instance variable is false
    • returns false if already in a meeting
  • public void readEmail()
    • just prints Email read!" to console
  • public boolean annoyingBoss()
    • always returns true!

Part 3

After writing retail worker, write another class, of your choice, that implements the interface as well.

Previous

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!