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.

Respuesta :

Answer:

Array can be used to do this program

Explanation:

#include <iostream>

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<x; i++)

{

 if(mini>Numlist[i])

 {

  mini=Numlist[i];

 }

}

//to adjust the numbers now

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

{

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

}

//This is to print the adjusted numbers

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

{

cout<<Numlist[i] <<" ";

}

return 0;

}