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

  1. \ Comp 462
  2. \ Balraj Sidhu   Set: 14D4
  3. \ Date: March 28, 1990
  4. \ Problem 2.7
  5.  
  6. : tank_volume  ( l w h -- )
  7.         cr rot dup ." lenght " . ." feet"            ( l w h -- w h l )
  8.         cr rot dup ." width  " . ." feet"            ( w h l -- h l w )
  9.         cr rot dup ." height " . ." feet"            ( h l w -- l w h )
  10.         cr * *     ." volume " . ." cubic feet." ;   ( l w h -- )
  11.  
  12. : unsigned_tank_volume  ( l w h -- )
  13.         cr rot dup ." lenght " . ." feet"            ( l w h -- w h l )
  14.         cr rot dup ." width  " . ." feet"            ( w h l -- h l w )
  15.         cr rot dup ." height " . ." feet"            ( h l w -- l w h )
  16.         cr * *     ." volume " u. ." cubic feet." ;   ( l w h -- )
  17.  
  18. \ Part b
  19. \ The largest number for signed integers is: 31.
  20. \ The largest number for unsigned integer is: 40.
  21.  
  22. \ Part c
  23. \ Use the warm word to reset fpc.
  24.  
  25.