NissanLeaf + NissanLeaf(year: int) + accelerate () : void + brake () : void Details Modify a NissanLeaf subclass (as above): • Set up the constructor so that make is set to "Nissan" and model is set...


Answer guys. Need correct answer otherwise downvote.


NissanLeaf<br>+ NissanLeaf(year: int)<br>+ accelerate () : void<br>+ brake () : void<br>Details<br>Modify a NissanLeaf subclass (as above):<br>• Set up the constructor so that make is set to

Extracted text: NissanLeaf + NissanLeaf(year: int) + accelerate () : void + brake () : void Details Modify a NissanLeaf subclass (as above): • Set up the constructor so that make is set to "Nissan" and model is set to "Leaf" and year is set to the year of the car. • Override the accelerate method so that it increases the speed by 5. • Override the brake method so that it decreases the speed by 2 (to a minimum of zero). Output The format of the output is given to you by the toString() method in the Car.java object class. This will be used by the main method in POD.java
Instructions<br>Today you willI be given a Car Class. From this, you will subclass Car to create a NissanLeaf Class.<br>The Car class has a constructor and several methods, including a tostring () method, 4 getters, 4 setters and an accelarate and brake method.<br>Car<br>make : String<br>model : String<br>year : int<br># speed: int<br>Car (make: String, model: String, year: int)<br>getMake () : String<br>getModel () : String<br>+ getSpeed () : int<br>getYear () : int<br>setMake (String) : void<br>+ setMode1 (String) : void<br>setSpeed (int) : void<br>+ setYear (int) : void<br>accelerate () : void<br>brake () : void<br>tostring () : String<br>

Extracted text: Instructions Today you willI be given a Car Class. From this, you will subclass Car to create a NissanLeaf Class. The Car class has a constructor and several methods, including a tostring () method, 4 getters, 4 setters and an accelarate and brake method. Car make : String model : String year : int # speed: int Car (make: String, model: String, year: int) getMake () : String getModel () : String + getSpeed () : int getYear () : int setMake (String) : void + setMode1 (String) : void setSpeed (int) : void + setYear (int) : void accelerate () : void brake () : void tostring () : String

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here