please help me i want to make a program that implement functions and arrays using pointers.The user provides an array of integer data, while the system calculates the average ,standard deviation,and median of the array.

i am unable to convert the input data string into separate parts and save into another separate variable.the maximum number of input integers is
50.

Hi,

I don't understand why are you reading input from the user as a string ? or do you have to ? You can go like this:-

#include <iostream>

using namespace std;

int main(){
          int x = 0;
          cout<<"How many integers you want to enter ? ";
          cin>>x;

          int* arr = new int[x];
          // now calculate the average
          float average = 0.0f;
          for(int i = 0; i < x; i++){

}

}

Sorry, last post was a mistake !!!!!!!!!!

Hi,

I don't understand why are you reading input from the user as a string ? or do you have to ? You can go like this:-

#include <iostream>

using namespace std;

int main(){
          int x = 0;
          cout<<"How many integers you want to enter ? ";
          cin>>x;

          int* arr = new int[x];
          // now calculate the average
          float average = 0.0f;
          for(int i = 0; i < x; i++){
                  average = average + arr[i];
          }

         cout<<"Average is "<<average / x<<endl;
         delete x;

}

Thanx vsha041 u change my mind
i have done the whole programming task successfully i shall post the whole program later

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.