Course Solutions Uncategorized (Solved) : Java Hw Submarine Class Load Turnon Turnoff Methods Method Receive Time Integer Code Far P Q32238907 . . . .

(Solved) : Java Hw Submarine Class Load Turnon Turnoff Methods Method Receive Time Integer Code Far P Q32238907 . . . .

 

(JAVA HW) In the submarine class, over-load the turnOn andturnOff methods, so that the method can receive a time integer.

This is my code so far:

public class Vehicle {

//attributes

String color;

String model;

//constructor

public Vehicle(String color, String model) {

super();

this.color = color;

this.model = model;

}

//methods

public void turnOn(){

System.out.println(“The vehicle has been turned on”);

}

public void turnOff(){

System.out.println(“The vehicle has been turned off”);

}

}

public class Submarine extends Vehicle {

//attributes

int maxLoad;

int maxDepth;

//constructor

public Submarine(String color, String model, int maxLoad, intmaxDepth){

super(color,model);

this.maxLoad = maxLoad;

this.maxDepth = maxDepth;

}

//methods

public void turnOn(int time){

System.out.println(model + ” will be turned on in “+time+”minutes”);

}

public void turnOff(int time){

System.out.println(model + ” will be turned off in”+time+”minutes”);

}

public void descend(){

System.out.println(model+” has descended”);

}

public void useRadar(){

System.out.println(model+” has used

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post