home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C ++ / Applications / Lotto / lotto_data_class.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-16  |  853 b   |  48 lines  |  [TEXT/CWIE]

  1.  
  2. #define MAX_STRUCTS 5000
  3.  
  4. // the struct that holds the data
  5. typedef struct lottonum {
  6.     int set[6];
  7.     char date[20];
  8.     int record_number;
  9.     int reds;
  10.     int whites;
  11.     int blues;
  12.     int evens;
  13.     int odds;
  14.     
  15.     struct lottonum *prev;
  16.     struct lottonum *next;
  17. } lotto_struct;
  18.  
  19.  
  20. // the class that does the work
  21. class lotto_data {
  22.     
  23.     public:
  24.         int number_of_records;
  25.         int user_request;
  26.         char user_input[20];
  27.         lotto_struct *record[MAX_STRUCTS];
  28.         
  29.         lotto_data();
  30.         ~lotto_data();
  31.         bool read_file( void );
  32.         bool check_for_file( void );
  33.         void clear_records( void );
  34.         void clear_user_input( void );
  35.         bool set_struct_file( void );
  36.         bool save_whole_file( void );
  37.         bool update_struct_file( void );
  38.         bool edit_struct_file( void );
  39.         void simple_save( void );
  40.         
  41.     private:
  42.         void get_stats( int );
  43.         void bubble_sort_set( int );
  44.         void clear_structs( void );
  45.         
  46. };
  47.  
  48.