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

 

gaurav.gupta@mq.edu.au arrays > positiveMultiples
prev  |  next  |  chance

Define a function that when passed an integer array and an integer (say key), returns an array containing all POSITIVE items in the array that are divisible by key. The order of items in the resulting array should be the same as the order in which they occur in the original array.


positiveMultiples([], 10) → []
positiveMultiples([20], 10) → [20]
positiveMultiples([-20], 10) → []

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

int[] positiveMultiples(int[] data, int key) { }

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: 4 Post-solution available

Copyright Nick Parlante 2017 - privacy