Ask Question
13 December, 10:41

When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by subtracting the smallest value from all the values. The input begins with an integer indicating the number of integers that follow. Assume that the list will always contain less than 20 integers. Ex: If the input is 5 30 50 10 70 65, the output is:20 40 0 60 55For coding simplicity, follow every output value by a space, including the last one.

+2
Answers (1)
  1. 13 December, 12:10
    0
    class TestCode {

    public static void main (String args[]) {

    Scanner scanner = new Scanner (System. in);

    int n = scanner. nextInt ();

    int arr[] = new int[n];

    int min = Integer. MAX_VALUE;

    for (int i = 0; i
    arr[i] = scanner. nextInt ();

    if (min > arr[i]) {

    min = arr[i];

    }

    }

    for (int i = 0; i
    System. out. print ((arr[i]-min) + " ");

    }

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by ...” in 📘 Engineering if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers