EasyManuals Logo

Sharp MZ-800 User Manual

Sharp MZ-800
221 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
Page #27 background imageLoading...
Page #27 background image
The
program
can
no
longer
be
listed,
since
the
NEW
command
erased
the
program
from
memory.
Entering
the
NEW
command
allows
you
to
now
write
a
new
program
in
memory.
Enter
the
following
program.
10
INPUT
“A=";A
20
INPUT
“B=";B
30
C=A+B
40
PRINT
“A+B=";C
50
END
This
program
will
calculate
the
sum
of
the
two
values
A
and
B
input
from
the
keyboard.
Two
new
statements
are
used
in
this
program.
These
are
the
INPUT
statement
and
the
LET
statement
(LET
is
represented
by
the
equal
‘‘="’
symbol
on
line
30).
The
INPUT
statement
on
line
10
reads
whatever
number
(don’t
type
characters)
you
type
in
from
the
keyboard
and
assigns
it
as
the
value
of
A.
The
INPUT
statement
on
line
20
reads
a
second
number
typed
in
from
the
keyboard
and
assigns
it
as
the
value
of
B.
The
LET
statement
on
line
30
calculates
the
sum
of
values
A
and
B
and
assigns
the
result
as
the
value
of
C.
At
the
moment
in
our
program,
the
letters
A,
B,
and
C
each
represent
a
numeric
value,
When
letters
of
the
alphabet
are
assigned
values
like
this,
they
are
called
‘‘variables”’.
Enter
the
RUN
command
after
typing
in
the
above
program.
The
screen
will
change
as
follows:
10
INPUT
“A=";A
20
INPUT
“B="";B
30
C=A+B
40
PRINT
“A+B=";C
50
END
RUN
|CR
A=
Type
in
any
number
and
press
the
[CR
|
key.
The
message
‘‘B=”"
will
be
displayed following
the
above.
A=35
cr)
B=
Type
in
another
number
and
press
the
|CR|
key.
The
sum
of
A
and
B
will
now
be
displayed
as
fol-
lows.
A=35
B=23|cR|
A+B=
58
The
program
shown
here
is
very
simple.
If
you
like,
you
can
write
your
own
programs
by
combining
some
of
the
commands
and
statements
which
are
explained
in
Chapter
6.
You
may
be
confused
by
the
words
‘‘statement’’
and
‘‘command’’.
Both
commands
and
statements
control
operation
of
the
computer.
The
distinction
between
commands
and
statements
is
thatcommands
are
generally
entered
without
line
numbers
and
are
executed
immediately
after
they
are
entered.
State-
ments
however,
are
included
in
a
program
and
are
only
executed
when
the
program
is
started
by
the
RUN
command.
In
practice,
most
commands
and
statements
can
be
used
both
with
or
without
line
numbers,
so
the
distinction
between
them
is
more
traditional
than
qualitative.
3-6

Other manuals for Sharp MZ-800

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sharp MZ-800 and is the answer not in the manual?

Sharp MZ-800 Specifications

General IconGeneral
BrandSharp
ModelMZ-800
CategoryDesktop
LanguageEnglish

Related product manuals