Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I do not know any other example inputs or outputs as they are not mentioned in the problem. Please help and do everything you can.
I do not know any other example inputs or outputs as they are not mentioned in the problem. Please help and do everything you can. Thank you!
ShopDriver.java This file is the driver that will allow you to simulate the Mechanic objects and Car objects that will visit a Mechanic. You will do the following in the main method of your ShopDriver: Create 1 Car object called cl of type SUV with a mileage of 15000, a nextoilchange of 14600, and a tireLife array with the values {0.70, 0.32, 0.45, 0.50} Create 1 Mechanic object called ml named Raul Call ml's service method on cl Print to the console ml and cl on separate lines Now it's time to practice debugging by creating your own test scenario similar to the one above to verify your code behaves as expected. Please add code to your main method to test one nontrivial feature of your program and leave a comment explaining which requirement from the assignment your code is meant to test. Some examples of requirements that may be valuable to test are: o Verify one of your variables is set to its default value when the constructor is passed an illegal value as a parameter. o Verify a Car object that was instantiated using the copy constructor does not have reference equality with the Car object that was passed as the parameter to the copy constructor. Verify no variables are changed by the Mechanic's service () method if the Car parameter does not need an oil change or any new tires. o Verify numcars is properly incremented when initializing a new Car object with any of the Car class constructors. Feel free to test your code yourself with more scenarios! Just make sure to clearly mark the one scenario you want us to grade with a comment The following is the expected output for the ShopDriver class (not including the test case you come up with): allisonnakazawa Allisons-MBP allisonSolution % java ShopDriver This is a mechanic named Raul. I charge $44.99 for an oil change, and I charge $59.99 for a new tire. I've made $224.96 in revenue. This is a car of type SUV with a mileage of 15000 miles. I'm due for a checkup in 3000 miles, and my average tire life is 92%. ShopDriver.java This file is the driver that will allow you to simulate the Mechanic objects and Car objects that will visit a Mechanic. You will do the following in the main method of your ShopDriver: Create 1 Car object called cl of type SUV with a mileage of 15000, a nextoilchange of 14600, and a tireLife array with the values {0.70, 0.32, 0.45, 0.50} Create 1 Mechanic object called ml named Raul Call ml's service method on cl Print to the console ml and cl on separate lines Now it's time to practice debugging by creating your own test scenario similar to the one above to verify your code behaves as expected. Please add code to your main method to test one nontrivial feature of your program and leave a comment explaining which requirement from the assignment your code is meant to test. Some examples of requirements that may be valuable to test are: o Verify one of your variables is set to its default value when the constructor is passed an illegal value as a parameter. o Verify a Car object that was instantiated using the copy constructor does not have reference equality with the Car object that was passed as the parameter to the copy constructor. Verify no variables are changed by the Mechanic's service () method if the Car parameter does not need an oil change or any new tires. o Verify numcars is properly incremented when initializing a new Car object with any of the Car class constructors. Feel free to test your code yourself with more scenarios! Just make sure to clearly mark the one scenario you want us to grade with a comment The following is the expected output for the ShopDriver class (not including the test case you come up with): allisonnakazawa Allisons-MBP allisonSolution % java ShopDriver This is a mechanic named Raul. I charge $44.99 for an oil change, and I charge $59.99 for a new tire. I've made $224.96 in revenue. This is a car of type SUV with a mileage of 15000 miles. I'm due for a checkup in 3000 miles, and my average tire life is 92%
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started