package comp1110.exam;
* COMP1110 Final Exam, Question 1.1
public class Q1Furthest {
Copyright By Assignmentchef assignmentchef
* Given an array of integers and a special value target,
* return the value in the array that is numerically furthest from
* target. If the array contains two different values equally
* close to target, return the larger value.If the array is
* empty, return target.
* @param inAn array of integers
* @param target a target value to search for in the array
* @return the value in the array that is numerically furthest from
* target, returning the larger of equally close values, and
* returning target if the array
* has no entries.
public static int findFurthest(int[] in, int target) {
// FIXME complete this method
return Integer.MAX_VALUE;
CS: assignmentchef QQ: 1823890830 Email: [email protected]
Reviews
There are no reviews yet.