Question: Consider the following class: public class FlightInstruction { /* Responsible for holding a flight instruction * for a autonomous quadcopter. * * Instructions will be
Consider the following class:
public class FlightInstruction { /* Responsible for holding a flight instruction
* for a autonomous quadcopter.
*
* Instructions will be queued after creation for execution.
* After execution, they should be placed in a hashtable for
* easy retrieval of flight logs.
*
* Don't worry about the size of the hashtable. */
String instructionID;
float roll;
float pitch;
float yaw;
float throttle;
public FlightInstruction(String instructionID, float roll, float pitch, float yaw, float throttle) { this.instructionID = instructionID;
this.roll = roll;
this.pitch = pitch;
this.raw = yaw;
this.throttle = throttle;
}
/** ..Getters and Setters.. **/
@Override
public int hashCode() { // Implement me!
}
}
Implement the hashcode method for this class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
