Create a class called Car. Make this class have a constructor that saves the make and model. Also, make each car have a variable called mileage that defaults to 15. Add a method called drive that adds...


Create a class called Car. Make this class have a constructor that saves the make and model. Also, make each car have a variable called mileage that defaults to 15.







Add a method called drive that adds to the car's mileage. Ignore negative values.






Add another method called getStatus that returns the make, model, and mileage of a car.






In this problem, submit only the Car.java file. Once you submit, the Demo.java will run to test your code.



Demo.java e<br>

Extracted text: Demo.java e
Test Case 1<br>Toyota Corolla has driven 1940 miles. In<br>Ford F-150 has driven 18208 miles.<br>Chevrolet Camaro has driven 171 miles. In<br>

Extracted text: Test Case 1 Toyota Corolla has driven 1940 miles. In Ford F-150 has driven 18208 miles. Chevrolet Camaro has driven 171 miles. In

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here