Question: For this exercise, you will create a CyberStudent class with the following characteristics / properties: CyberStudent has 2 basic states and each of these basic

For this exercise, you will create a CyberStudent class with the following characteristics/properties:
CyberStudent has 2 basic states and each of these basic states have several substates :
a) awake (0)
o substates:
eating (0)
working (1)
b) sleeping (1)
o substates:
dreaming (2)
snoring (3)
A constructor that accepts a String object which is the name of the newly created CyberStudent, which is initially sleeping and dreaming
CyberStudent has 2 basic methods that change the state of the CyberStudent to one of the 2 basic allowable states:
boolean Awake( int substate)
boolean Sleep( int substate)
Check the substate parameter (int substate) in the above methods for consistency (within range) before changing the state (and substate). Return true if state was successfully changed, false otherwise. If there is a problem, return false without changing anything. In addition, create mutator methods for each of the substates : boolean Eat(), Work(), Dream(), Snore() Each of these substate mutator methods should check for consistency, for example, a Cyberstudent in the awake state cannot be placed in the substate snoring. Return true if substate was changed, false otherwise. CyberStudent has 2 accessor (getter) methods:
1. getState () : returns a String object giving the current state (and substate ) of the CyberStudent
2. getName () : returns a String object giving the name of the CyberStudent object.
Display the current substate for the student then change the substate to each available substate and display the substate after each change.
Notes: DO NOT USE Strings to store the "state" of the CyberStudent ... Include appropriate JavaDoc comments.
Sample console output:
HAL is asleep and dreaming. HAL is asleep and snoring. HAL cannot be awake and snoring. HAL cannot be awake and snoring. HAL is awake and eating
package edu.buffalostate.cis425.sp24.put-your-username-here;
/**
*
* Note: DO NOT USE Strings to store the "state" of
* the CyberStudent.

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!