Zebra0.com

alice calculationsAlice Programming

Alice Programming

Learn Alice in FREE step-by-step lessons.

Quiz on Calculations and Functions

After doing all parts of the lesson you should be able to answer these questions.

Write down the answers first. Click the check to check your answer.

1. If a math problem has several steps, what is the best way to create the result? answer

   Do it one step at a time using several variables with good names for each step.

2. What does the % symbol do? answer

   The % finds the remainder: 5%2 is 1.

3. In Math.min(???, ???) The two ??? indicates that this function requires two _____ answer

   arguments

4. With the code shown below, where does the bear cub move to?
answer

   He moves half way to the castle gate.

5. In the code shown below, what is getDistanceTo?
answer

   a function

6. Adding 1 to a variable is called _____ answer

   incrementing

7. If we add several values to a variable one at a time, we would call that variable ____ answer

   an accumulator or total: Accumulators keep a running total by adding in each value one at a time.

8. If you are calculating the distance to move an object, what type will the variable distance be? answer

   Double

9. What does this code do?
answer

   num3 is the total of num2 and num2, num3 is the average of num1 and num2

10. In the code below, what happens?
answer

   The child moves next to the soccer ball

Please review the material for any questions you miss.