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

 

testSLAPHL_Q10_V2


Write a method that accepts an array of integers, a maximum number called "find" and a value to subtract called "subtract". Return the original array with all values greater than "find" reduced by "subtract".


testSLAPHL_Q10_V2([4, 6, 8, 6, 5, 4, 4], 4, -2) → [4, 8, 10, 8, 7, 4, 4]
testSLAPHL_Q10_V2([12, 4, -5, 3, 8, 10, 4, -1, 3, 4, 6], 4, 71) → [-59, 4, -5, 3, -63, -61, 4, -1, 3, 4, -65]
testSLAPHL_Q10_V2([12, 4, -5, 3, 8, 10, 4, -1, 3, 4, 6], 73, 71) → [12, 4, -5, 3, 8, 10, 4, -1, 3, 4, 6]

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

public int[] testSLAPHL_Q10_V2(int[] nums, int find, int subtract) { }

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

Copyright Nick Parlante 2017 - privacy