EasyManua.ls Logo

Sharp PC-1500 - Page 54

Sharp PC-1500
169 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
A
ll
and
more
about Sharp
PC
-1500
at
http:/lwww.PC-1500.info
10
FOR I = 1 TO 8 10 I = 1
20
12 IF I >B
THEN
100
[
wm
e $tatements
to
be
repeat
ed
)
20
I
so
me
statements
to
be r
epeated
I
90
NEXT
90
I =
I+
1
1
00
END
92
GOTO 12
1
00
END
Our
second
sa
mple program illustrates h
ow
one m:iy prog
rar
n a "genetal loop
",
who
se
repc
ti·
tions
arc
co
nt
ro
lled
by
the value
of
a variable. We begin by asking the
user
how
many numbers
h
e/she
pl
ans
to e
nt
er.
We
store this numb
er
in a
va
riable N
and
we proceed
to
loop through the
statements wh
ic
h take in a number for proce
ss
in
g.
The loop is
exec
ut
ed
N t imes, unle
ss
N is
le
ss
than
or
equal to zero, in which
cas
e we END
with
out
furth
er proce.sing.
Program Listing:
10
N =
O:V
=
O:
T = O : A s O
20
W
AIT
0
30
INPUT " HOW
MA
NY
VALUES?
40
IF
N = 0
TH
EN GOTO
999
50
FOR I =
1 TO N
60
CLS
: CURSOR 0
70 INPUT V
BOT
,,,
T+V
90
NEXT
I
100 WAIT : CLS : CURSOR 0
110 A = T / N
1
20
PAUSE
"TO
T
AL
"'
";
T
1
30
PR
I
NT
"AVERAGE
=
";
A
999 END
Keystroke
s:
";N
rur_
uOO
L€
l[
.1Jr•
"'
1
orn1
=1rn0i<
1n
1
CJ
UJ1
=
1w
I
SHIFT
!
CJ
QOC:::;J
00
l
••TC
I
m
rn
oo
mco
CD
oo
@
..
1
rn
oo
mm
mro
CD
''"
"'
1
C"J
nnruoo1
...
•«
1 oo
rn
oo
c.o
1
....
°'
1mmmODoom1
••
IF,
,m
1
...
.,.1
, ... ,,,, c::J, ... ,,.
,CD
['A]
l•
•U)
Le] co
ru
OD
[ = ]
OD
w OD
00
QD
m CQJ CD CQJ
rnrnrn1
....
1
CD
CID
CI!
EQJ
®CD
C:O
CD
C!J
CQJ
QD
t
anu
l
(GJ
00
[CJ
[I]
(TI
I
$1ft1rI
0 a:J OJJOOIIJ
[Q]
00
l
11m•
l
[ZJ
(§j
moo
w
OD
CTI
00
l•
••t•I
52
Do not sale this PDF !!!

Table of Contents

Other manuals for Sharp PC-1500

Related product manuals