8. [10] Interfaces. There is an abstract class named Jet. This will be the paren
ID: 3904838 • Letter: 8
Question
8. [10] Interfaces. There is an abstract class named Jet. This will be the parent class of a number of child cli describing different types of Jets. The declaration for Jet is public abstract class Jet ( For consistency, all of the child classes of Jet must have the same interface. The inter include 4 methods: 1. setHeading which takes a double parameter called newHeading and has no retu 2. setPower which takes an integer parameter named engine and a double param powerLevel. It also returns nothing. 3. readAltimeter which takes no parameters but returns an integer. readHeading which takes no parameters and returns an integer The interface is named FlightControls Write the FlightControls interface below. 4. Rewrite the declaration for Jet above to use the new FlightControls interfa Calcoo50 that inherits from Jet.Explanation / Answer
FlightControls Interface
interface FlightControls
{
void setHeading(double newHeading);
void setPower(int engine, double powerLevel);
int readAltimeter();
int readHeading();
}
Jet class using above interface:
public abstract class Jet implements FlightControls{
...
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.