Back to home

Topics

1. Can you say the use of PRINT command?

PRINT command is used to write any text or number on the Logo screen. It takes only one input. The PRINT command can be written in short as PR. For an example, in the Input Box, type PRINT 50. This command will print the number 50 in the commander window. PRINT 50 can also be written as PR 50.


2. Write a command to print ‘Hai World’ on the Logo text screen.

To print any text or number on the Logo screen, you can use PRINT command. If you want to print text, the text is written using “ (Double quotes) or [] (square brackets). Type the following commands in the Input Box. Press the Enter key after each command. That is, write command as

PRINT “ Hai World

Or

Print [Hai World]

 

3. Which command is used to clear the text screen?

CLEARTEXT command is used to clear the contents on the screen. The short form of CLEARTEXT command is CT. This command does not take any input. In MSWLogo, it clears the Output/Command in the Recall List Box.

4. Write an example to show the working of a CT command?

CT or CLEARSCREEN command is used to clear the Logo screen. We can explain the CLEARSCREEN command using an example,

  1. Type the Logo command, PRINT [I Love My Country]
  2. Press the Enter key.
  3. We will get the output in the Recall List Box.
  4. Then type the command CLEARTEXT or CT and press Enter key.
  5.  It will clear the contents in the Recall List Box.

5. What are the arithmetic operators used in Logo?

In MSW Logo we can perform arithmetic operations. The symbols used for performing these operations are:



6. What are the arithmetic operations that Logo can perform?

We can perform addition, subtraction, multiplication and division using arithmetic operators. The result produced by these commands can we display using PRINT or PR command.

7. Can you explain four arithmetic operators using PR command with suitable examples?

Arithmetic Operators are used to perform some arithmetic calculation and PR or PRINT command is used to display result on Logo screen after calculations done by arithmetic operators. Shall we go through some examples.

1. PR 100 + 21

This command will print the sum of the two numbers 100 and 21. Here first, two numbers will add and display the result 121 on the Logo screen.

2. PR 100 – 30

This command will give the difference of the two numbers 100 and 30. Here first, two numbers will subtract and display the result 70 on the Logo screen.

3. PR 10 * 10

This command will give the product of the two numbers 10 and 10. In computer, ‘*’ symbol is used instead of ‘x’. Here first, two numbers will multiply and display the result 100 on the Logo screen.

4. PR 10/5

This command will give the division of two numbers 10 by 5. In computer, ‘/’ is used to represent division. Here first, divide 10 by 5 and display the result 2 on the Logo screen.

8. Can you explain any two arithmetic operator using FD command?

FD or FORWARD command is used to move the turtle forward as the number mentioned in the command.

1. FD 10 + 20

This command will first add two numbers and then move the turtle by the result. Here the number 10 and 20 added and then move the turtle 30 units.

2. FD 50 – 10

This command will first subtract two numbers and then move the turtle by the result. Here the number 10 subtract from 50 and then move the turtle 40 units.

9. Can you explain combination of any arithmetic operators using with FD command?

We can use more than one operator in a single command. According to the operators priority calculation are taking place. * have higher priority, so if a command contains * symbol first it perform multiplication then only other operations. For example,

FD 30 + 10 – 5, this command contains symbols + and -. Operator + (Addition) have higher priority. So this command will first add 30 and 10 and then from the result subtract 5 to move the turtle by the result. Thus the result will be 35 units. The turtle moves 35 units forward.

10. Define SUM Function.

The SUM function is used for adding two or more numbers. SUM function used instead of arithmetic operator ‘+’. So don’t have to give + sign between two numbers, write PRINT SUM and then the two numbers with a space in between.

For example, Add two numbers, say 41 and 16, then write the command as,

    PR SUM 41 16

Here SUM function, add two numbers 41 and 16 and print 57 as result on Logo screen.



11. How will you add more than two numbers using the SUM operation?

The SUM function is used for adding two or more numbers. For adding more than two numbers, enclose the operation SUM and the inputs in simple brackets. Provide space in between these numbers mentioned in the command.

For example, PR (SUM 34 56 87 90)

Here SUM function, adds four numbers 34, 56, 87 and 90 and print 267 as result on Logo screen.

12. Define Difference Function?

The DIFFERENCE function is used to subtract two numbers. It can be used instead of arithmetic operator ‘-’. Provide space in between these numbers mentioned in the command.

For example, PR DIFFERENCE 120 10

Here the DIFFERENCE function, subtract 10 from 120. Logo will print 110 as the result on the screen.

13. Explain Product Function?

The PRODUCT function is used for multiplying two numbers. This function also takes two inputs and both of these inputs should be numbers. Provide space in between these numbers mentioned in the command.

For example, PR PRODUCT 10 10,

Here PRODUCT function, multiply two numbers 10 and 10. Logo will print 100 as the result on the screen.

14. Explain the command ‘PR QUOTIENT 20 10’ .

PR QUOTIENT 20 10 defines QUOTIENT Function, The QUOTIENT Function also take two inputs and both of these inputs should be numbers. It divides the first number by the second number and gives the quotient as the result.

Here, it divides first number 20 by the second number 10 and print 2 as the result on the screen.

15. Define Remainder Function.

The REMAINDER function takes two inputs and both these inputs should be numbers. It divides the first number by the second number and displays only the remainder as the result.

For example, PR REMAINDER 30 7

Here, divide the first number 30 by the second number 7 and print remainder 2 on the Logo screen.

16. How many units would the turtle move forward in the following?

Paid Users Only!
Paid Users Only!
Paid Users Only!
Paid Users Only!
Paid Users Only!
Paid Users Only!
Paid Users Only!
Paid Users Only!
Paid Users Only!
Powered By