EasyManua.ls Logo

Sharp PC-1500 - Page 38

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
:/l
www.PC-1500.info
As an exam
pl
e of a progr
am
which
fai
ls to do t
hi
s, ent
er
the following:
Program
Lis
ting:
10
A - 0
20
INPUT A
30
PRINT
A*P
I
Ke
ys
tr
okes:
r11
ooru
r= 1
00l
••
n•
I
W(J)JOJ
oom
uo
mm,
,
••
,
rnrnmoocoao
rn
(A]
mm1
.....
,
Now im
agi
ne t.he user as he runs
the
program
...
The first thing th
at
appears
on
the display
is
n
quns
tion mark. The
kn
owl
cd
go
ab
le u
ser
will realize that s
om
e
do
to
is requi
re
d
but
he will
h~vc
no
id
ea what th
at
d.ata
sh
ould be. Suppose he takes a wild guess. and luck
il
y,
enters a number.
Suddenly, a long and comp
li
cated number
app
ears. What does it mean?
He
pr
ess
es
ENTER to
cont
inue,
but
t
he
pr
ogram ends. F
ro
m his viewpoin
t,
th
e whole experience
h
a~
been a waste
of
time. Why? Because
of
poor
programming.
One soluti
on
to this problem
is
to u
se
PRINT
or
PAUSE statements to h
elp
the user along.
With this idea \\'e
-c
an
re-
i,,
1
1r
itc our
pro
g
ram
as
fo
ll
ows
:
Pr\l9ram
Li
$
tin9
:
10 A = 0
20
PAU
SE
"E
NTER ANY
NUMB
ER"
30
IN
PUT A
40 AP = A *
Pl
50
PRI NT A; " TIMES
Pl
= " ; AP
Keystrokes:
CD [ A J
I=
1 OD l
HTl•
I
moommrnocm1
..
..,
1
~rn
CtJITJ
OD@m
00
CD !
sP
>a
l
00
OiJ
00
ru
CB:!
'
""
" I
c:::::J
!!
.,
•I
CD
CU
[!]
aJ
ODCD
CXJ
!f.,
ca
l
mm
r.cJ
01
O=J
m
rn
m rn ,
,..
,.
.1
m
rn
C!J oo co
CEJ
com
CED
c:o
1H
Fr
1
c:::i
,
.,.
.«,
rr
1cn
oom
rn
,
.,..,
., m
CDt
•••c•
IC:
= J
@
o.
ei!J
'
"""'
1 c:::i 1
SHIFT
1
moo
m 1
..
TF.
1
This versi
on
is much
mo
re u
se
ful because
it
"pr
o
mpt
s" (or provoke
s}
t.h
e
us
er
for in
pu
t and
because
it identifi
es
the
ou
tpu
t.
36
Do not sale this PDF !!!

Table of Contents

Other manuals for Sharp PC-1500

Related product manuals