home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
forth
/
compiler
/
fpc
/
source
/
p4_7bs.seq
< prev
next >
Wrap
Text File
|
1990-04-14
|
772b
|
31 lines
\ Balraj Sidhu Set: 14D4
\ Comp 462 - Forth
\ Date: April 12, 1990
\ Problem 4.7
7 constant days/week
24 constant hours/day
60 constant seconds/minute
60 constant minutes/hour
: seconds_day ( -- sd )
hours/day minutes/hour * seconds/minute um* 2dup d. ;
: seconds_week ( sd -- )
2dup d2* d2* d2* 2swap d- d. ;
: minutes_day ( -- md )
hours/day minutes/hour * dup . ;
: minutes_week ( md -- )
days/week * . ;
: time ( -- )
cr
." The number of seconds in a day is: " seconds_day cr
." The number of seconds in a week is: " seconds_week cr
." The number of minutes in a day is: " minutes_day cr
." The number of minutes in a week is: " minutes_week cr ;