Docsity

Algorithm Worksheet, Exercises of Algorithms and Programming

Toggle sidebar
bg1
Name: ____________________________________________ Date: _______________________ Class: ____________________
How Do You Make A Program Wait? Lesson—Algorithm Worksheet Answer Key 1
Algorithm Worksheet
1. Add the two numbers below using the ADDITION algorithm you studied in school.
345 + 176 + __________ Show all steps, as done on the slide 5 example.
2. Now, come up with the steps for the addition you just performed. Start with step 1,
“Write both numbers one above the other,” and so on.
Do not miss any steps. This creates your algorithm!
3. Consider the maze shown below. The task is to make the robot move from either the
green or blue circle, and go through the maze, that is, move forward and then turn left to
go through the two blocks without bumping into the walls. Based on the material covered
in the slides so far, discuss all the problems you may face if you use only move blocks
using exact distances, such as “move 5 rotations forward.”
5 rotations
pf2

Partial preview of the text

Download Algorithm Worksheet and more Exercises Algorithms and Programming in PDF only on Docsity!

Name: ____________________________________________ Date: _______________________ Class: ____________________

How Do You Make A Program Wait? Lesson — Algorithm Worksheet Answer Key 1

Algorithm Worksheet

  1. Add the two numbers below using the ADDITION algorithm you studied in school. 345 + 176 + __________ Show all steps, as done on the slide 5 example.
  2. Now, come up with the steps for the addition you just performed. Start with step 1, “Write both numbers one above the other,” and so on. Do not miss any steps. This creates your algorithm!
  3. Consider the maze shown below. The task is to make the robot move from either the green or blue circle, and go through the maze, that is, move forward and then turn left to go through the two blocks without bumping into the walls. Based on the material covered in the slides so far, discuss all the problems you may face if you use only move blocks using exact distances, such as “move 5 rotations forward. ”

5 rotations

Name: ____________________________________________ Date: _______________________ Class: ____________________

How Do You Make A Program Wait? Lesson — Algorithm Worksheet 2

  1. U se the conditional command “until” to write a sequence of steps to tell a robot to stop when it bumps into a wall. Example : Play at recess until you hear the bell ring; then go back to class.
  2. Write down in steps the “ algorithm ” you will use to have a robot navigate the maze diagram drawn below, using conditional commands (and NOT move commands). Write out your algorithm in words, such as: “ Move forward, ” etc.
  3. Now draw the NXT program blocks (such as those we learned about on slides 14-18) that you will use to implement the algorithm above. Approximate forms of the blocks are fine.

5 rotations