Question: The BusinessPlane class extends Airplane. It has one additional instance variable, boolean isJet, that is true if the plane has jet engines and is false

The BusinessPlane class extends Airplane. It has one additional instance variable, boolean isJet, that is true if the plane has jet engines and is false if it has some other form of propulsion. Since most BusinessPlane objects have jet engines, it is not necessary to input the initial value of the isJet instance variable in the constructor. Instead, the instance variable is given an initial value of true. But a modifier method is provided to change the value if necessary. Complete the following definition for the BusinessPlane class:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

public class BusinessPlane extends Airplane

{

private boolean isJet;

public BusinessPlane( double weight, double length )

{

super (weight, length);

isJet = true;

}

public boolean getJet(){

if (n = 0){

return false;

}

}

public void setJet(boolean n){

return n;

}

}

The BusinessPlane class extends Airplane. It has one additional instance variable, boolean

Complete the following definition for the BusinessPlane class: public class BusinessPlane extends Airplane 1 2. 3 4 5 private boolean is Jet; public Business Plane( double weight, double length ) 2 super (weight, length); isJet = true; } 10 10 11 - 12 - 13 public boolean getJet() { if (n 0) { return false; 1 public void setJet (boolean n) { return n; 17 18 19 } public static void main(String[] args) // test your code here Business Plane b = new BusinessPlane ( 8709.5, 17.6); 1 2. 3 4 5 6 7 8 9 System.out.println( b.getJet() ); // should output true b.setJet( false); System.out.println( b.getJet() ); // should output false }

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!