code about introduction of java 1

Are you pressed for time and haven’t started working on your assignment yet? Would you like to buy an assignment? Use our custom writing services for better grades. Even if your deadline is approaching fast, our writers can handle your task right when you need it. Our writers will complete your order from scratch and make sure it’s completely unique.


Order a Similar Paper Order a Different Paper

http://deanzacollegecis.jenniferparrish.net/home/c…link for activity11.1&11.2

http://deanzacollegecis.jenniferparrish.net/home/c…link for activity12.1&12.2

http://deanzacollegecis.jenniferparrish.net/home/c…link for lab6


Answer the following review questions from Lesson 11 by either typing directly into the textbox below or by uploading a document with your answers. Please include the question along with your answer to make your responses easy to read.

1. Given the below Car class, write a child class of Car named Tesla. The Tesla class has an additional private boolean variable named autoPilotEnabled. It also has two constructors – a default constructor and a three argument constructor. Both constructors call the appropriate constructors of the parent class. Tesla also has a getter and setter for the autoPilotEnabled variable. Finally, it has a toString method that calls the toString of Car, as well as concatenating the autoPilotEnabled variable.

public class Car {   
private String make;
private String model;

public Car() {
make = "Make unknown";
model = "Model unknown";
}

public Car(String make, String model) {
this.make = make;
this.model = model;
}
public String getMake() {
return make;
}

public String getModel() {
return model;
}

public void setMake(String make) {
this.make = make;
}
public void setModel(String model) {
this.model = model;
}

public boolean timeForService(int currMileage) {
if (currMileage > 10000) {
return true;
}
return false;
}

@Override public String toString() {
return "Make: " + make + "nModel: " + model;
}
}

2. Next, override the timeForService method for the Tesla class to return true if the currMileage is greater than 15000.

Answer the following review questions from Lesson 12 by either typing directly into the textbox below or by uploading a document with your answers. Please include the question along with your answer to make your responses easy to read.

1.Given the below Car class, update the default constructor so that it calls the two argument constructor.

public class Car {   
private String make;
private String model;

public Car() {
make = "Make unknown";
model = "Model unknown";
}

public Car(String make, String model) {
this.make = make;
this.model = model;
}
public String getMake() {
return make;
}

public String getModel() {
return model;
}

public void setMake(String make) {
this.make = make;
}
public void setModel(String model) {
this.model = model;
}

public boolean timeForService(int currMileage) {
if (currMileage < 10000) {
return true;
}
return false;
}

@Override public String toString() {
return "Make: " + make + "nModel: " + model;
}
}

2. Next, override the equals method for the above Car class using the formula provided in class.

Writerbay.net

Do you need help with this or a different assignment? Even when your task is complicated and the deadline is in less than 2 days, you still have every chance to get a good grade for it. How? By completing the order form, you will get the finest custom-written assignment at an affordable price. We also deliver a number of services for free (e.g., revisions, editing, checking the text for authenticity). Use our paper writing service to receive effective help with your homework.


Order a Similar Paper Order a Different Paper