Sharp MZ-700 Series Owner's Manual page 19

Personal computer
Hide thumbs Also See for MZ-700 Series:
Table of Contents

Advertisement

[EXERCISE]
6 + 4
• 6 - 4
2 . 3 X
I5 +
9 X ( 9 - 2 )
I
+ 5
PR I N T
( 6 + 4 ) / ( 6 — 4 )
5
P R I N T
3 X ( 5 + 9 X ( 9 - 2 ) - 6 / ( 4 - 2 ) > + 5
200
P R I N T
( 3 + 4 ) X ( 5 + 6 )
7 7
P R I N T
(1 0 + 2 0 )
/ 6 X ( 2 + 3 )
2 5
P R I N T
(1 0 + 2 0 ) / ( 6 X C 2 + 3 ) )
1
[ANSWER]
3 .
( 3 + 4 ) x ( 5 + 6 )
4 .
10+20
6
x ( 2 + 3 )
5 .
10+20
6 x ( 2 + 3 )
After going through the exercises, try typing in [T][I]@[8] and pressing the [CR| key; the answer " 4 0 " is
displayed. The reason for this is that BASIC interprets the question mark in the same manner as the
instruction PRINT. Remember this as a convenient, abbreviated form of the PRINT instruction.
Now try entering the following. (The quotation marks are entered by holding down | SHIFT
and
pressing the [2] key.)
E e m e m m s o E H E H
As you can see, the characters within quotation marks are displayed on the screen, but the answer is not.
Now try entering the following.
E O f f l m O T E O G E E l G H E E ]
This causes ABCDEFG to be displayed on the screen.
In other words, using the PRINT instruction together with quotation marks tells the MZ-700 to display
characters on the screen exactly as they are specified between quotation marks. The characters within
any set of quotation marks are referred to as a "character string" or "string".
Now go on to enter the following.
E e m e m E m s B E B m s s i H E J E E ]
This causes the following to be displayed on the screen.
4 + 9 = ^ 1 3
(The "i_," symbol indicates a space. Actually, nothing is display-
ed on the TV screen in the position indicated by this symbol.)
In other words, the instruction above tells the computer to display both the character string "4 + 9 ="
and the result of the arithmetic expression "4 + 9 =". Now try entering the following.
fpiiRimif^mrni^RfoiFiFirTii^i+ifQiicH
After typing in this entry, the following should be displayed on the screen.
The reason the screen appears different this time is because the PRINT instruction displays items of
information (character strings or the results of arithmetic expressions) differently depending on whether
they are separated from each other by semicolons or commas.
4 + 9 =
1 3
Semicolon ( ; )
Comma ( , ) .
Instructs the computer to display items immediately adjacent to each other.
Instructs the computer to display the item at the position which is 10
spaces (columns) from the beginning of the display line.

Advertisement

Table of Contents
loading

Table of Contents