X329: arrayOfMultiples

Given two integers size and num, return an array that can hold size integers and is filled with multiples of num, starting with num. For example, if the values 8 and 3 are passed in, the array returned would contain the values {3, 6, 9, 12, 15, 18, 21, 24}. You may assume that size will be positive.

Examples:

arrayOfMultiples(8, 3) -> {3, 6, 9, 12, 15, 18, 21, 24}
arrayOfMultiples(4, 2) -> {2, 4, 6, 8}

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.