title: A function to enter data into an array that quits entry at a EOF but allows to resume entry
body: <p>So i have the assignment to write a menu-driven mini-statistics package. 
  A user should be able to enter up to 200 items of float data. </p>
  
  <p>The program should calculate or show:</p>
  
  <ol>
  <li>The data it self in an organized table format  </li>
  <li>the number of items </li>
  <li>the mean</li>
  <li>the standard deviation</li>
  <li>the variance </li>
  <li>the median</li>
  <li>the mode of the data</li>
  <li>The high values in the data</li>
  <li>the low values in the data</li>
  </ol>
  
  <p>When entering the data though if you enter in CTRL-Z or CTRL-D or the end-of-file 
  symbol on your system it drops out of the data entry loop and takes you back to the main menu. </p>
  
  <p>The menu options are easy enough</p>
  
  <ol>
  <li>Enter data</li>
  <li>Display the processed data</li>
  <li>Quit program</li>
  </ol>
  
  <p>But when you go back to enter data again it will ask you the program should also ask if you wish to add more data to your data set or create a new data set.</p>
  
  <p>So i'm not sure how to do this kind of function where it stores a count of if I have already entered in data. Also i'm not quite sure how to do the End of File with the entering data into an array.</p>
  
  <p>I have some pseudo code but nothing much else. </p>
  
  <p>Some advice is greatly appreciated.</p>
  
  <p>I already have all my other functions for processing the data from the array and displaying it but just not sure how to do the entry.</p>
  
  <p>Right now here is the basic part of my program to show how the menu should flow back and forth between entry and display My entry function is crap i know.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;math.h&gt;
  #include &lt;string.h&gt;
  #include &lt;ctype.h&gt;
  #include &lt;time.h&gt;
  #define MAX 200
  
  //menu functions
  void menu();
  int displaymenu();
  
  //data entry function
  void enterdata(double a[],int n);
  
  
  void displaydata(double a[],int n);
  //display data functions
  void func_printdata(double a[],int n);
  int func_item_number(double a[],int n);
  double func_largest(double a[],int n);
  double func_smallest(double a[],int n);
  double func_mean(double a[],int n);
  double func_median(double a[],int n);
  double func_mode(double a[],int n);
  double func_variance(double a[],int n);
  double func_standard_deviation(double a[],int n);
  
  int main(){
      double x[MAX];
  
      menu();
  
      //needed for all basic programs to run for the professor
      system("pause");
  
      return(0);
  }
  
  void menu(){
  
      int com;
  
      do{
          com = displaymenu();
          switch(com){
              case 1:
                  enterdata(x,MAX);
                  break;
              case 2:
                  displaydata(x,MAX);
                  break;
              case 3:
                  printf("Have a nice day\n");
                  break;
          }
      }while(com != 3);   
  }
  
  int displaymenu(){
  
      int choice;
  
      printf("*------------------------------------------------------------*\n");
      printf("|    Mini Stats Package                                      |\n");
      printf("*------------------------------------------------------------*\n");
      printf("*                                                            *\n");
      printf("*    This Program will perform the following:                *\n");
      printf("*                                                            *\n");
      printf("*    1. Enter Data.                                          *\n");
      printf("*                                                            *\n");
      printf("*    2. Display the data and the following statistics:       *\n");
      printf("*       the number of data items, the high and low values    *\n");
      printf("*       in the data, the mean, the median, mode, variance    *\n");
      printf("*       and the standard deviation.                          *\n");
      printf("*                                                            *\n");
      printf("*    3. Quit Program                                         *\n");
      printf("*                                                            *\n");
      printf("*------------------------------------------------------------*\n");
      printf("Your Choice? ");
      scanf("%d",&amp;choice);
      printf("\n\n\n");
      return choice;      
  }
  
  void enterdata(double a[], int n){
  
      double a[];
      int i;
      int j;
      int k;
      char ynchoice;
  
      printf("Enter in your data");
  
      if(k =&lt; 0){
          for(i=0 ; i &lt; n; i++){
              j=1+i
              k++;
              printf("Item %d: ",j);
              while((scanf("%d",&amp;a[i]))!= EOF){
                  scanf("%f",&amp;a[i]);
  
      else{ 
          printf("Do you wish to add new data to existing sample? (Y/N) ");
          scanf("%c",&amp;yesnochoice);
          if (ynchoice == 'y'||'Y'){
  
          }
          else{
  
          }
  
      menu(); 
  
  }
  
  return(0);
  
  void displaydata(double a[], int n){
  
      double a[];
      int data_item_number;
      double data_largest;
      double data_smallest;
      double data_mean;
      double data_median;
      double data_mode;
      double data_variance;
      double data_standard_deviation;
  
      data_item_number = func_item_number(a,MAX);
      data_largest = func_largest(a,MAX);
      data_smallest = func_smallest(a,MAX);
      data_mean = func_mean(a,MAX);
      data_median = func_median(a,MAX);
      data_mode = func_mode(a,MAX);
      data_variance = func_variance(a,MAX);
      data_standard_deviation = func_standard_deviation(a,MAX);
  
  
      printf("-----------------------------------------------------------*\n");
      printf("    Mini Stats Package                                     |\n");
      printf("-----------------------------------------------------------*\n");
      printf("Data Items:\n");
      printf(func_printdata(a,MAX));
      printf("Number of data items : %d\n",data_item_number);
      printf("Largest data item    : %f\n",data_largest);
      printf("Smallest data item   : %f\n",data_smallest);
      printf("Mean                 : %f\n",data_mean);
      printf("Median               : %f\n",data_median);
      printf("Mode                 : %f\n",data_mode);
      printf("Variance             : %f\n",data_variance);
      printf("Standard Deviation   : %f\n",data_standard_deviation);
      printf("-----------------------------------------------------------*\n");
  
      menu();
  
  
  }
  
    // Rest of the functions for processing data 
  </code></pre>