Question: /** * Returns the sum of the numbers between zero and the * first parameter that are divisible by the second number. * For example,
/**
* Returns the sum of the numbers between zero and the
* first parameter that are divisible by the second number.
* For example, sumOfProducts(10, 3) will return 3 + 6 + 9
* = 18, and sumOfProducts(10, 2) will return 2 + 4
* + 6 + 8 + 10 = 30 and sumOfProducts(-10, 2) will
* return -2 + -4 + -6 + -8 + -10 = -30.
* @param bound the upper bound
* @param divisor the divisor
* @return sum
*/
public int sumOfProducts(int bound, int divisor) {
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
