Ask Question
23 August, 13:32

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.

+5
Answers (1)
  1. 23 August, 13:52
    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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers