home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / source / p2_7dc.seq < prev    next >
Text File  |  1990-03-31  |  619b  |  18 lines

  1. \ Answers for problem 2.7
  2. \ Author: Dickson Cheng  03/29/90 09:47:29.14
  3.  
  4. \ a)
  5.  : TANK_VOLUME         ( L W H -- )
  6.        CR ROT DUP ." Length" . ." feet"         ( L W H -- W H L )
  7.        CR ROT DUP ." Width " . ." feet"         ( W H L -- H L W )
  8.        CR ROT DUP ." Height" . ." feet"         ( H L W -- L W H )
  9.        CR * *     ." Volume" . ." cubic feet ; ( L W H -- )
  10. \ b)
  11. \ Since the largest positive number of an signed integer is 32767,
  12. \ for a cubical tank where l=w=h, the maximum length of each would be the
  13. \ cube root of 32767 (floored) or 31.  And the maximum volume will be 29791.
  14.  
  15.  
  16.  
  17.  
  18.