home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / source / p2_10dc.seq < prev    next >
Encoding:
Text File  |  1990-03-30  |  628 b   |  32 lines

  1. \ TANK PROGRAM FOR PROBLEM 2.10
  2. \ Author: Dickson Cheng  03/30/90 14:06:25.97
  3.  
  4. : .LWH          ( l w h -- )
  5.         SWAP ROT
  6.         CR ." Length: " .
  7.         CR ." Width : " .
  8.         CR ." Height: " . ;
  9.  
  10. : AREA          ( l w h -- )
  11.         3DUP
  12.         5 ROLL * 2 *
  13.         -ROT   * 2 *
  14.         +
  15.         -ROT   * 2 *
  16.         +
  17.      CR ." Surface area: " . ;
  18.  
  19. : VOLUME        ( l w h -- )
  20.         CR ." Volume: " * * . ;
  21.  
  22. : TANK          ( l w h -- )
  23.         3DUP .LWH
  24.         3DUP AREA
  25.              VOLUME ;
  26.  
  27. : MESSAGE       ( -- )
  28.         DARK CR ." To run TANK type l w h TANK." ;
  29.  
  30. MESSAGE
  31.  
  32.