home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
forth
/
compiler
/
fpc
/
tutor
/
l5p140
< prev
next >
Wrap
Text File
|
1990-07-15
|
3KB
|
69 lines
\ ╔════════════════════════════════════════════════════╗
\ ║ Lesson 5 Part 140 F-PC 3.5 Tutorial by Jack Brown ║
\ ╚════════════════════════════════════════════════════╝
\ Part five of CHKBOOK.SEQ
/* ************************************************************ */
/* */
/* Function: TOT_DEPOSIT Total deposits this session */
/* */
/* Date: July 25, 1988 */
/* */
/* Interface: TOT_DEPOSIT ( -- ) */
/* */
/* ************************************************************ */
: TOT_DEPOSIT ( -- )
70 CLR_HBAR
DEP_COUNT @ 0=
IF
." There have been no deposits so far this session "
." so the total is: "
ELSE DEP_COUNT @ 1 =
IF
." Only one deposite has been made so far this session "
." for a total of: "
ELSE
." There were " DEP_COUNT @ .
." deposits made so far this session "
." that total: "
THEN
THEN
DEP_DOLLARS @ DEP_CENTS @ $XX.XX CR
70 HBAR ;
/* ************************************************************ */
/* Function: AVERAGE Reports average check written this */
/* session */
/* Date: July 25, 1988 */
/* */
/* Interface: AVERAGE ( -- ) */
/* */
/* ************************************************************ */
CREATE MILLS 4 ALLOT
VARIABLE ADOLLARS
VARIABLE ACENTS
: AVERAGE ( -- )
CHK_COUNT @ 0=
IF
50 CLR_HBAR
." You have not written any checks this session." CR
50 HBAR
ELSE
CHK_DOLLARS @ 1000 UM*
CHK_CENTS @ 10 * 0 D+
CHK_COUNT @ 0 D/
5 0 D+ 10 0 D/
OVER OVER 100 0 D/ DROP ADOLLARS !
100 0 DMOD DROP ACENTS !
60 CLR_HBAR
." For this session the average check written was: "
ADOLLARS @ ACENTS @ $XX.XX CR
60 HBAR
THEN ;