Quiz Answer Key
Quiz Answer Key
- Logo is a simple and easy-to-learn programming language primarily used for teaching students and children how to program a computer. Its key benefits are that it is fun, enhances children’s logical sense, develops programming skills, and is considered real Computer Science.
- The MSW Logo screen consists of a Drawing window and a Commander window. The Drawing window is the upper part where a triangle-shaped turtle creates drawings, while the Commander window below is where users write and execute commands in a command line text box.
- The repeat command is used to perform iteration, which is the repetition of a sequence of commands a specified number of times. The general form is repeat number [commands], where number is how many times the commands inside the square brackets will be executed.
- The penup (pu) command lifts the turtle’s pen so it can move without leaving a trail of ink. The hideturtle (ht) command makes the turtle invisible on the screen but does not affect its ability to draw when its pen is down.
- A variable is created using the make command, followed by the variable name in double quotes and its value (e.g., make “n 1). To access the variable’s value in a computation or command, its name must be preceded by a colon (e.g., print :n).
- A procedure is a named sequence of commands that can be executed like a built-in command, providing a way to encapsulate a collection of actions. A procedure definition must begin with the reserved word to and end with the reserved word end.
- The random command is used to generate an unpredictable outcome. It takes one argument and produces an integer value chosen uniformly at random that is greater than or equal to 0 and less than the value of its argument.
- Colors on computer screens are represented using red, green, and blue (RGB) components, with values for each ranging from 0 to 255. The command to change the pen’s color is setpencolor [r g b], where r, g, and b are the numeric values for red, green, and blue, respectively.
- Operator precedence determines the order in which arithmetic operations are evaluated. In the example, print 60 * sqrt 2 prints 60 times the square root of 2, while print sqrt 2 * 60 prints the square root of 120 because the multiplication (*) operator has precedence over the sqrt operator and is performed first.
- The setxy command moves the turtle to a specific location on the graphics window’s two-axis coordinate plane. It takes two arguments: the first is treated as the x-coordinate (horizontal axis) and the second as the y-coordinate (vertical axis).
——————————————————————————–