home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / autopsp.zip / REGRESS / REGRESS.CPP < prev    next >
C/C++ Source or Header  |  1994-01-23  |  2KB  |  57 lines

  1. // Main
  2. // This program outputs a Upper and Lower bound around a
  3. //  computed prediction based on previous data about estimated
  4. //  and actual LOC occurances.  All the data is printed to the
  5. //  screen, but the input data must come from a file.
  6.  
  7. #include "conio.h"                // So I can use clrscr().
  8. #include "rfind.h"                // RangeFinder Class.  (workhorse)
  9.  
  10. void main(int argc, char *argv[])
  11. {
  12.   RangeFinder RF;                 // Instantiate RangeFinder.
  13.  
  14.   char filename[50];              // Filename
  15.   char temp[50];                  // text buffer.
  16.   double percent=0;               // Percent of error to look for.
  17.   double estimate=0;              // New estimated LOC.
  18.  
  19.   strcpy(filename, argv[1]);
  20. //  gets(filename);                 // Get the file for input data.
  21. //  printf("%s",filename);
  22.  
  23. //  gets(temp);
  24.   strcpy(temp, argv[2]);
  25.   percent=atof(temp);             // Find the % confidence desired.
  26.  
  27.  
  28. //  gets(temp);                     // Estimated LOC for the program.
  29.   strcpy(temp, argv[3]);
  30.   estimate=atof(temp);            // Find the estimate.
  31.  
  32.                                   // Do all the work.
  33.   RF.CalcRange(percent, filename, estimate);
  34.  
  35.                                   // Print the results found.
  36.   FILE *out;
  37.  
  38.   if (NULL== (out=fopen("data.dat","wt"))){
  39.     perror("Couldn't open data.dat");
  40.     exit(1);
  41.   }
  42.   fprintf(out,"B0         %lf\n",RF.B0);
  43.   fprintf(out,"B1         %lf\n",RF.B1);
  44.   fprintf(out,"Range      %lf\n",RF.Range);
  45.   fprintf(out,"Projection %lf\n",RF.PLOC);
  46.   fprintf(out,"UPI        %lf\n",RF.UPI);
  47.   fprintf(out,"LPI        %lf\n",RF.LPI);
  48.  
  49. }
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.