home *** CD-ROM | disk | FTP | other *** search
/ Chip 1995 March / CHIP3.mdf / programm / prog2 / dersubs.ada < prev    next >
Encoding:
Text File  |  1991-07-01  |  864 b   |  40 lines

  1.                                        -- Chapter 7 - Program 2
  2. with Text_IO;
  3. use Text_IO;
  4.  
  5. procedure DerSubs is
  6.  
  7.    package Int_IO is new Text_IO.Integer_IO(INTEGER);
  8.    use Int_IO;
  9.  
  10.    type NEW_INT      is new INTEGER range 12..127;
  11.    type NEW_INT_TYPE is new INTEGER;
  12.  
  13.    subtype SUB_INT     is NEW_INT;
  14.    subtype NEW_SUBTYPE is NEW_INT range 12..127;
  15.    type    DER_SUB     is new NEW_SUBTYPE range 12..32;
  16.  
  17.    Arrow, Dart : NEW_INT;
  18.    Size        : NEW_INT_TYPE;
  19.    Thing       : INTEGER := 15;
  20.    Point       : NEW_SUBTYPE;
  21.  
  22. begin
  23.  
  24.    Size := 10;
  25.    Arrow := 23;
  26.    Dart := 2 * Arrow - 25;
  27.    Dart := Arrow + 2 * (NEW_INT(Size + 2) + NEW_INT(Thing));
  28.    Dart := Arrow + 2 * NEW_INT(Size + NEW_INT_TYPE(Thing));
  29.    Point := Arrow + Dart;
  30.  
  31. end DerSubs;
  32.  
  33.  
  34.  
  35.  
  36. -- Result of execution
  37.  
  38. --   (No output from this program.)
  39.  
  40.