home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / autopsp.zip / REGRESS / PRG6A.CPP < prev    next >
C/C++ Source or Header  |  1995-07-23  |  2KB  |  52 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(void)
  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.   clrscr();                       // Change all screen pixels black
  20.  
  21.   printf("Welcome to the Range Finder.\n");
  22.   printf("Enter the name of the file containing your data.\n");
  23.   gets(filename);                 // Get the file for input data.
  24.  
  25.   printf("Enter the percentage of confidence you would like.\n");
  26.   gets(temp);
  27.   percent=atof(temp);             // Find the % confidence desired.
  28.  
  29.   printf("Enter the estimated LOC for your current program.\n");
  30.   gets(temp);
  31.   estimate=atof(temp);            // Find the estimate.
  32.  
  33.                                   // Do all the work.
  34.   RF.CalcRange(percent, filename, estimate);
  35.  
  36.                                   // Print the results found.
  37.   printf("Results:\n\n");
  38.   printf("B0               %lf\n",RF.B0);
  39.   printf("B1               %lf\n",RF.B1);
  40.   printf("Range            %lf\n",RF.Range);
  41.   printf("Projected LOC    %lf\n",RF.PLOC);
  42.   printf("UPI              %lf\n",RF.UPI);
  43.   printf("LPI              %lf\n",RF.LPI);
  44. }
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.