Ask Question
26 February, 00:48

c+ + 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. Ex: If the input is: 5 30 50 10 70 65 the output is: 20 40 0 60 55 The 5 indicates that there are five values in the list, namely 30, 50, 10, 70, and 65. 10 is the smallest value in the list, so is subtracted from each value in the list.

+5
Answers (1)
  1. 26 February, 01:17
    0
    Array can be used to do this program

    Explanation:

    #include

    using namespace std;

    int main () {

    int x;

    int mini;

    cout << "How many number i to be normalized";

    cin >> x;

    int Numlist[x]; / / x is an array of the numbers that will be inputted

    cout << "Kindly input the numbers to the adjusted";

    for (int i = 0; i < x; i++) {

    cin>>Numlist[i]; / / this will Store all the numbers inputted

    }

    mini = Numlist[0]; / / this is to set the first element as the minimum to compare with others

    for (i=0; i
    {

    if (mini>Numlist[i])

    {

    mini=Numlist[i];

    }

    }

    //to adjust the numbers now

    for (i=0; i
    {

    Numlist[i]=Numlist[i] - mini;

    }

    //This is to print the adjusted numbers

    for (i=0; i
    {

    cout<
    }

    return 0;

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “c+ + 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 ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers