about | help | code help+videos | done | prefs |
Write a method that returns an array indicating the maximum speed you should run in any of the five gears of your Mazda Miata. The array 'gear' will contain integers indicating what gear you want to be in. The parameter speedPer indicates how fast the speed increases as the gears increase. For example, if speedPer is 20, that means you have a maximum speed of 20 in gear 1, 40 in gear 2, etc. Since the Miata only has 5 gears (the older model), if the gear number is ever greater than 5, use a zero to indicate that there is a problem. Look at the test data for examples. test2021_03_11_APP1SLHL_miataMaxRPMS([4, 7, 3, 8, 1], 26) → [104, 0, 78, 0, 26] test2021_03_11_APP1SLHL_miataMaxRPMS([7], 35) → [0] test2021_03_11_APP1SLHL_miataMaxRPMS([5, 2, 1, 4], 35) → [175, 70, 35, 140] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 250
Copyright Nick Parlante 2017 - privacy