Brothers LearningFREE LESSONS FOR EVERY CLASSROOM
Brothers Learningany school district
Test · Tuesday, October 6

Sense · Move · Code

Programming test. Show what you can do.

Four days ago most of you had never connected a sensor to a motor. Since then you have built a robot, written events, found and fixed bugs, planned in pseudocode and run a real lab. This test asks you to show all of it on paper. Read every question twice. When a question asks you to explain, use the words we learned.

FormatPaper, by yourself
Time40 minutes
Points50
Sense, Move, Code1. When ___, then ___.2. Input or output?3. Find the bug.4. Write the pseudocode.

Absent today? You will take this test with me. See me as soon as you are back to set a time before or after school or during lunch. Use the Day 4 page and your notebook to study first.

Name ________________________________

Class period ________

Date ______________

Score ______ / 50

A

Part A · Words · 7 points

Write the letter of the best definition next to each word.

  1. ____ input
  2. ____ output
  3. ____ sequence
  4. ____ event
  5. ____ debugging
  6. ____ pseudocode
  7. ____ decomposition

A. Steps done in a specific order

B. A program written as plain sentences, for people to read

C. Information that goes into a system

D. Finding and fixing the reason a program does not do what you meant

E. Something that happens that a program is waiting for

F. Breaking a big job into smaller jobs

G. What a system does in response

B

Part B · Input or output · 6 points

Write IN for input or OUT for output.

  1. ____ The color sensor reading a green brick
  2. ____ The double motor turning two wheels
  3. ____ Tilting a lever on the controller
  4. ____ The single motor lifting an arm
  5. ____ A light turning on when the program says so
  6. ____ A red brick held up in front of the sensor
C

Part C · Multiple choice · 8 points

Circle the best answer.

1. What does a connection card do?

a. Charges the motor
b. Pairs two pieces of hardware so they work together
c. Stores your program
d. Turns the color sensor on

2. Why does an event block have a rounded top, like a hat?

a. So it looks different from a motor block
b. Because it must be the last block in a stack
c. Because nothing comes before an event, so nothing can snap above it
d. So it can only be used once

3. Blocks that are snapped together in a stack run…

a. all at the same time
b. from bottom to top
c. in a random order
d. from top to bottom, in order

4. A program waits for a blue brick, but the team only has red, yellow and green bricks. What happens?

a. The robot treats green as blue
b. That event never happens
c. The program crashes
d. The robot runs that stack once anyway

5. Your program does not work. What is the best first step?

a. Delete it and start over
b. Change three things at once to save time
c. Read it out loud from the top, one block at a time
d. Ask another team for their program

6. Who is pseudocode written for?

a. The robot
b. The computer
c. The people on the team
d. The LEGO website

7. Which step is small enough to turn into a block?

a. Go to the kitchen
b. Run both motors forward for 2 seconds
c. Do the delivery
d. Be careful

8. On Friday the color sensor read correctly at 1 cm but often missed at 3 cm. What does that tell a scientist?

a. The sensor is broken
b. Every instrument has a range where it can be trusted
c. Colors change with distance
d. The program has a bug

D

Part D · Read the code · 9 points

Say exactly what the robot does.

1. The sensor is shown a yellow brick.

when color is red run motor forward when color is yellow run motor backward wait 2 seconds stop motor

What does the motor do? (3 pts)

______________________________
______________________________

2. The program starts.

when program starts turn arm motor up 90° wait 1 second turn arm motor down 90° wait 1 second turn arm motor up 90°

Where is the arm at the end, up or down? How do you know? (3 pts)

______________________________
______________________________

3. The sensor is shown a green brick.

when color is red stop both motors when color is blue run both motors forward

What does the robot do, and why? (3 pts)

______________________________
______________________________

E

Part E · Find the bug · 8 points

Each program has one bug. Name it and fix it.

1. The team wanted the rover to drive forward for 3 seconds and stop. It barely moves.

when program starts run both motors forward stop both motors wait 3 seconds

The bug: ______________________________

The fix: ______________________________

2. The team wanted a sorter that pushes red bricks left and green bricks right. Green bricks never move.

when color is red push the brick left when color is red push the brick right

The bug: ______________________________

The fix: ______________________________

F

Part F · Plan it · 8 points

Decompose the job, then write the pseudocode.

The job: A crane robot waits beside a truck. When it sees yellow, it lowers its hook a quarter turn, waits 2 seconds while a load is attached, raises the hook a quarter turn, and spins to the left for 1 second. When it sees red, it stops everything.

1. Break the yellow job into at least four smaller jobs, in order. (3 pts)

______________________________________________
______________________________________________
______________________________________________

2. Write the pseudocode for the whole program, both colors. One action per line. (5 pts)

______________________________________________
______________________________________________
______________________________________________
______________________________________________
______________________________________________
______________________________________________
______________________________________________

G

Part G · Your lab · 4 points

Friday’s lab, in your class.

Your class:

Physics. A robot travels 84 cm in a 4-second run. (a) What is its average speed in cm/s? Show your work. (b) On a distance-time graph, a faster setting makes a steeper line. Explain why, using the word slope.

______________________________________________
______________________________________________
______________________________________________

Standards. Science and engineering practices (strand 1) in P.1, C.1, IPC.1; Physics P.5A; IPC IPC.5B. CSTA grades 6–8: 2-AP-10 pseudocode and algorithms; 2-AP-13 decomposition; 2-AP-17 testing and refining programs; 2-CS-02 hardware and software that collect and exchange data.

Teacher notes · Test

Printing: use the Print button. Each student’s copy shows the Part G question for the class selected on screen, so choose the class before printing each set. The answer key is not on this page; it was delivered to you separately.

Points: A 7, B 6, C 8, D 9, E 8, F 8, G 4. Total 50.