IBM 5110 Basic Introduction page 91

Table of Contents

Advertisement

c
Supply sales
representat ives
names.
Enter dates
for the weeks.
Supply sales
figures.
Compute
monthly
totals.
Print figures
and sales
representatives
names.
Compute
weekly and
grand totals.
Print totals.
For this program, you have to supply the month's sales figures, the
name of the month, and the last day of each week covered. The
report is then printed automatically. Now enter the following program:
o
0
ton
I:::
h P
f~
U 13 P
f":-,
ivi
F
I]
P P PIN TIN G M
0
N
'r
H
I... "-(
~::;
(.' : )
L E
~~;
I?
F PO f< T
(021)
tl~~::::'
(IDLE
I~
,
(I
0 3 0 f:
.~; ~::
' B J P P L E '
0040
C$~'CUBBINS'
PHI NT' EN T E P M ()
NTH..
L () f:) T II
f~
Y 0 F [
t,
C
H
hJ E [: l< '
INPUT M$ . . W$ . . X$,Y$ . . Z$
P
F<
I NT
'ENTE P F I Cit./ PEf:; FD R
(~DI..,E
P ,
0080 INPUT Al,A2 . .
A3,A4
00<10
PI~INT
'ENTER
FICiUPE~3
FOP f{IPPLE'
0100
INPUT
Bl,B2,B3,B4
o
:I. 1. 0 P
r~
I NT' E N T E R F I D
1...I1~
E
~:;
F C)
F~
C:
1...1
B [: I N
~~)
,
o :I.
2 0 I ( . . . . ! P
1 .
..1
Tel., c
~.:~
.' C 3 .' C
' +
{,
' : , ' :1.3
(I
(.1 ~:)::::(i:l.
+ tl
::~+(.i 2)
+
~il.l'
0140 B5=Bl+B2+B3+B4
fl
:I.
~:.;
[I
C
~.:,:,i
::::
C: 1 -:-- C
:2 -}-
C
:3
+ C
' +
o
1 6
(I
P R I NT
I...I~)
It,·,! CJ
I)
1 7 0 . . F L P . .
rl':j:,
o
1 -; 0 : ' . . . . i
[I
NTH I... "' (
~~:;
t" L [ ' : ::; PI::: P D
r~~
T F 0
F;~
j"'j
C) '" THO F H H H H
~~:
l:t H H
*~
H
0100 PI:{INT FLP
o
:I.
~1
0 P
I~
I N T
1...1
~::;
I N Ci
(I :.:::
0 0 . . F
I...
P
0200 :SALESMAN
WEEK ENDING
0210 PRINT USING 0220,FLP,W$,X$,Y$,Z$
o ; , : :
::.~
0
~*
H
H fi
H H
0230 PPINT FLP
I,)
2LJ· 0 P R I N T
1...1
~::)
1 NCO
:::.~
7
(I ..
F L. P
,I
(I
.~;
. .
f-~)
1 . . f.' , :,:: . . tl:::' . .
tll+
I) ::,::
~5
I]
P 1< I NT
1 •
..1 ::;)
I N
r:i
I]
~?
'7
(I .'
F
I...
P,C:
-:j:. ,
C 1 , C ; . : . : : . . C:.3
I
C
Lj,
o
2 (, 0 P
f,~
I NT U
~::>
I N G 0 2 '('
(I }
F
I...
P . . C
.~;
, C: 1. , C::2 , C::3 " C 1+
I)
2 ' ( -' 0 : H H
~~
H tt H H
a
H H ff , R: H
*~
f'
~i
tf
I
**~:t.
H
*~
H
** ,
H
**
o
2 BOT
:J. ::::
(11 -}-
B : 1 . + C l
. 2 (? 0 T
;2 :::: (:,
2 + D
::?
+ C ?
T 3 :::: () 3 + D:3 + C::5
T q,
::~ f~',l~
'Y'
r:
L~
+ C
1+
o
3 2 0 T
~5
::::
(:'j'.:.:j
+ E:
I,:,:,;
+ C
~5
J330 PPINT FLF
,
'::
~~ : : ~ : ~I
p
. I l : ~
(:!):
~ l : ! ' : -1 ~:! ~3
I
N
~=~
!J,
~
::; :.;;
0
~',
::' l ..
p
~~ ~~: ~I~ ~'~ ~T:
: : , : , : :
,,I,
:' 1 ,'
: : : : ~
..
~~
jl.:, ,.' ,
:T:
~ ;
. . :
1~
l '
U
"~
,::.1
I.J
:
...
(,:, .. , :::;.
H Yt
t1
n
H: ,
i'¥
H
i't
to?
t~
\"i' tt ,
H H
tt
,:~
H H
n ,
h H
) 3 {.
(I
~:)
T () P
Note that a PRINT FLP statement with nothing after it causes a blank
line to be printed. This form of the statement is used in lines 0180,
0230, and 0330 to include blank lines in the printed report.
Setting Up Your Own Format-PRINT USING and Image Statements
87
c
Supply sales
representat ives
names.
Enter dates
for the weeks.
Supply sales
figures.
Compute
monthly
totals.
Print figures
and sales
representatives
names.
Compute
weekly and
grand totals.
Print totals.
For this program, you have to supply the month's sales figures, the
name of the month, and the last day of each week covered. The
report is then printed automatically. Now enter the following program:
o
0
ton
I:::
h P
f~
U 13 P
f":-,
ivi
F
I]
P P PIN TIN G M
0
N
'r
H
I... "-(
~::;
(.' : )
L E
~~;
I?
F PO f< T
(021)
tl~~::::'
(IDLE
I~
,
(I
0 3 0 f:
.~; ~::
' B J P P L E '
0040
C$~'CUBBINS'
PHI NT' EN T E P M ()
NTH..
L () f:) T II
f~
Y 0 F [
t,
C
H
hJ E [: l< '
INPUT M$ . . W$ . . X$,Y$ . . Z$
P
F<
I NT
'ENTE P F I Cit./ PEf:; FD R
(~DI..,E
P ,
0080 INPUT Al,A2 . .
A3,A4
00<10
PI~INT
'ENTER
FICiUPE~3
FOP f{IPPLE'
0100
INPUT
Bl,B2,B3,B4
o
:I. 1. 0 P
r~
I NT' E N T E R F I D
1...I1~
E
~:;
F C)
F~
C:
1...1
B [: I N
~~)
,
o :I.
2 0 I ( . . . . ! P
1 .
..1
Tel., c
~.:~
.' C 3 .' C
' +
{,
' : , ' :1.3
(I
(.1 ~:)::::(i:l.
+ tl
::~+(.i 2)
+
~il.l'
0140 B5=Bl+B2+B3+B4
fl
:I.
~:.;
[I
C
~.:,:,i
::::
C: 1 -:-- C
:2 -}-
C
:3
+ C
' +
o
1 6
(I
P R I NT
I...I~)
It,·,! CJ
I)
1 7 0 . . F L P . .
rl':j:,
o
1 -; 0 : ' . . . . i
[I
NTH I... "' (
~~:;
t" L [ ' : ::; PI::: P D
r~~
T F 0
F;~
j"'j
C) '" THO F H H H H
~~:
l:t H H
*~
H
0100 PI:{INT FLP
o
:I.
~1
0 P
I~
I N T
1...1
~::;
I N Ci
(I :.:::
0 0 . . F
I...
P
0200 :SALESMAN
WEEK ENDING
0210 PRINT USING 0220,FLP,W$,X$,Y$,Z$
o ; , : :
::.~
0
~*
H
H fi
H H
0230 PPINT FLP
I,)
2LJ· 0 P R I N T
1...1
~::)
1 NCO
:::.~
7
(I ..
F L. P
,I
(I
.~;
. .
f-~)
1 . . f.' , :,:: . . tl:::' . .
tll+
I) ::,::
~5
I]
P 1< I NT
1 •
..1 ::;)
I N
r:i
I]
~?
'7
(I .'
F
I...
P,C:
-:j:. ,
C 1 , C ; . : . : : . . C:.3
I
C
Lj,
o
2 (, 0 P
f,~
I NT U
~::>
I N G 0 2 '('
(I }
F
I...
P . . C
.~;
, C: 1. , C::2 , C::3 " C 1+
I)
2 ' ( -' 0 : H H
~~
H tt H H
a
H H ff , R: H
*~
f'
~i
tf
I
**~:t.
H
*~
H
** ,
H
**
o
2 BOT
:J. ::::
(11 -}-
B : 1 . + C l
. 2 (? 0 T
;2 :::: (:,
2 + D
::?
+ C ?
T 3 :::: () 3 + D:3 + C::5
T q,
::~ f~',l~
'Y'
r:
L~
+ C
1+
o
3 2 0 T
~5
::::
(:'j'.:.:j
+ E:
I,:,:,;
+ C
~5
J330 PPINT FLF
,
'::
~~ : : ~ : ~I
p
. I l : ~
(:!):
~ l : ! ' : -1 ~:! ~3
I
N
~=~
!J,
~
::; :.;;
0
~',
::' l ..
p
~~ ~~: ~I~ ~'~ ~T:
: : , : , : :
,,I,
:' 1 ,'
: : : : ~
..
~~
jl.:, ,.' ,
:T:
~ ;
. . :
1~
l '
U
"~
,::.1
I.J
:
...
(,:, .. , :::;.
H Yt
t1
n
H: ,
i'¥
H
i't
to?
t~
\"i' tt ,
H H
tt
,:~
H H
n ,
h H
) 3 {.
(I
~:)
T () P
Note that a PRINT FLP statement with nothing after it causes a blank
line to be printed. This form of the statement is used in lines 0180,
0230, and 0330 to include blank lines in the printed report.
Setting Up Your Own Format-PRINT USING and Image Statements
87

Advertisement

Table of Contents
loading

Table of Contents