Ask Question
10 June, 23:41

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.

+2
Answers (1)
  1. 11 June, 00: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?
Find 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 and Technology 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