Logo 2

advertisement
F.1 Computer Literacy LOGO Notes & Exercise(2)
Name:________________
Class:______
Class No.:____
LOGO operation
In addition to being able to execute the specified value, LOGO can also calculate the vales within the
statement, the following are some examples:
1) Record what would happen:
Commands
(a)
CS
FD 10 + 20
(b)
CS
FD 70 – 40
(c)
CS
FD 2 * 15
(d)
CS
FD 5*(7+3-24/6)
Note 1:
Note 2:
Describe the results
Calculation operators:
Arithmetic operators
Explanation
+
Addition
-
Subtraction
*
Multiplication
/
Division
( )
Bracket
Operations order:
1st Calculate the formula within the bracket
2nd Follow the basic arithmetic operations
Note 3: Input methods:
Enter the required instruction action, and then enter a formula to calculate the values e.g.:
Move forward 5*(7+3-24/6) unit.
Command: FD 5*(7+3-24/6)
「*」,「+」,「-」,「/」,「(」,「)」are arithmetic operators
Page 1/4
Write statements for LOGO
We can add text to the LOGO program to display on the output window, e.g.:
2) Record what would happen:
Commands
Results
Commander
Screen
(a) CS
PR[I LOVE LOGO !]
(b) CT
FD 30
PR[I MOVE FORWARD !]
(c) CS
CT
PR[HELLO !]
(d) CT
PR[60*2]
(e) CT
PR(60*2)
Note 4: Input methods:
Enter「PR」, then the required text, values or formula, e.g.:
output:How are you?
commands:PR [ How are you ? ]
PR is the command. The contents inside the [
] is the text for the output.
Page 2/4
F.1 Computer Literacy LOGO Notes & Exercise(2)
Name:________________
Class:______
Class No.:____
Revision:
3) Please write two ways to display a pentagon:
(a)
4)
(b)
What is the output of the following commands?
Commands
Screen
LT 90 FD 170
BK 130 LT 90
FD 100
REPEAT 180 [FD 1 RT 1]
5)
Try to write the commands to display the following "letters" :
Letters
Commands
(a)
A
(b)
B
(c)
C
(d)
D
(e)
F
Page 3/4
Exercises:
6)
Write LOGO commands to calculate the following arithmetic operations:
(a)
10  4  2
(b)
6  8  16  4
(c)
15
4
3
(d)
(8  4)
 23
2
7)
Write the results of the following commands:
(a)
PR 5
(b)
PR[5]
(c)
PR (2+9)*8
(d)
PR[(2+9)*8]
(e)
PR[HELLO]
(f)
PR[I am Tom.]
(g)
PR[PR 5]
(h)
PR[FD 10]
Page 4/4
Download