package comp1110.exam;
* COMP1110 Final Exam, Question 1.1
public class Q1Remainder {
Copyright By PowCoder代写 加微信 powcoder
* Given an array of integers and a special value target,
* return the value in the array that has the smallest
* remainder when divided by target (ie the value with a
* remainder closest to zero). If the array contains two
* different values with remainders equally close to target,
* return the smaller value. If the array is empty, return
* target. If target is zero, return zero.
* @param in An array of integers
* @param target a target value to search for in the array
* @return the value in the array that when divided by target
* has a remainder closest to zero, returning the smaller of
* equally close values, and returning target if the array
* has no entries or the target is zero. i
public static int findCloseDivisor(int[] in, int target) {
// FIXME complete this method
return Integer.MAX_VALUE;
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com