Answer:
// Naive solution to find the minimum and maximum number in an array. public static void findMinAndMax(int[] A) ...
int max = A[0]; int min = A[0];
// do for each array element. for (int i = 1; i < A. ...
if (A[i] > max) { max = A[i]; ...
else if (A[i] < min) { ...
System. ...
{ ...
// find the minimum and maximum element, respectively.