id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > test2021_03_11_P1SLHL_miataService
prev  |  next  |  chance

Write a method that returns a string that informs you of how many oil changes, clutch replacements, and tire replacements you should have had in your Mazda Miata by the time you get to a certain number of miles on your odometer. Of course it matters how rough you drive your car. If you drive it rough you will need to do the replacements more frequently. For normal driving, you should get an oil change every 20000 miles, the clutch replaced every 65000 miles, and a new set of tires every 50000 miles. However, if you drive rough, these replacements should be done at 15000, 50000, and 40000 miles respectively. Look at the test data for examples. Make sure your response is grammatically correct!


test2021_03_11_P1SLHL_miataService(41000, true) → "You should have had 2 oil changes, 0 clutches, and 1 set of tires."
test2021_03_11_P1SLHL_miataService(41000, false) → "You should have had 2 oil changes, 0 clutches, and 0 sets of tires."
test2021_03_11_P1SLHL_miataService(27000, false) → "You should have had 1 oil change, 0 clutches, and 0 sets of tires."

...Save, Compile, Run (ctrl-enter)

public String test2021_03_11_P1SLHL_miataService(int miles, boolean rough) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 210

Copyright Nick Parlante 2017 - privacy