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_SLHL_miataMaintSched
prev  |  next  |  chance

Write a method that accepts as an input parameter, 'maxMiles' which is the number of miles on your Miata. Return an array of 30 strings indicating the maintenance schedule that should have been followed so far on the Miata. Maintenance should happen according to this schedule: Every 5000 miles you should have an oil change. Every 15000 miles you should have have your tires rotated, but not if you are replacing your tires. Every 50000 miles you should have a tune up. Every 60000 miles you should replace your tires. Every 100000 miles you need major maintenance. The array of strings will have 30 elements in it no matter what. Look at the test data for additional details and examples.


test2021_03_11_SLHL_miataMaintSched(147900) → ["5000 oil change", "10000 oil change", "15000 oil change + tire rotation", "20000 oil change", "25000 oil change", "30000 oil change + tire rotation", "35000 oil change", "40000 oil change", "45000 oil change + tire rotation", "50000 oil change + tune up", "55000 oil change", "60000 oil change + replace tires", "65000 oil change", "70000 oil change", "75000 oil change + tire rotation", "80000 oil change", "85000 oil change", "90000 oil change + tire rotation", "95000 oil change", "100000 oil change + tune up + major maintenance", "105000 oil change + tire rotation", "110000 oil change", "115000 oil change", "120000 oil change + replace tires", "125000 oil change", "130000 oil change", "135000 oil change + tire rotation", "140000 oil change", "145000 oil change", "NA"]
test2021_03_11_SLHL_miataMaintSched(141000) → ["5000 oil change", "10000 oil change", "15000 oil change + tire rotation", "20000 oil change", "25000 oil change", "30000 oil change + tire rotation", "35000 oil change", "40000 oil change", "45000 oil change + tire rotation", "50000 oil change + tune up", "55000 oil change", "60000 oil change + replace tires", "65000 oil change", "70000 oil change", "75000 oil change + tire rotation", "80000 oil change", "85000 oil change", "90000 oil change + tire rotation", "95000 oil change", "100000 oil change + tune up + major maintenance", "105000 oil change + tire rotation", "110000 oil change", "115000 oil change", "120000 oil change + replace tires", "125000 oil change", "130000 oil change", "135000 oil change + tire rotation", "140000 oil change", "NA", "NA"]
test2021_03_11_SLHL_miataMaintSched(12400) → ["5000 oil change", "10000 oil change", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA"]

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

public String[] test2021_03_11_SLHL_miataMaintSched(int maxMiles) { }

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: 230

Copyright Nick Parlante 2017 - privacy