CS: Algorithms and Flowcharts
Planning steps and showing program logic
Planning steps and showing program logic
CS - Grade 6-8
- 1
Write an algorithm with at least 5 steps for making a peanut butter and jelly sandwich. Use clear, numbered steps.
- 2
A flowchart starts with Start, then says Input age, then uses a decision diamond labeled age >= 13. If yes, it says Allow account. If no, it says Ask for parent permission. What does the decision diamond do?
- 3
Put these algorithm steps in the correct order: A. Pour cereal into a bowl. B. Eat the cereal. C. Get a bowl. D. Add milk.
- 4
Trace this algorithm: Set score = 0. Add 5 to score. Add 3 to score. If score > 6, subtract 2 from score. What is the final value of score?
- 5
In a flowchart, what shape is usually used for Start and End, and what shape is usually used for a process step such as total = total + 1?
- 6
Write a short algorithm that decides whether a number is even or odd. Your algorithm should include an input step, a decision step, and an output step.
- 7
A flowchart asks, Is the password correct? The yes path goes to Log in. The no path goes to Try again. What type of programming structure is this: sequence, selection, or repetition?
- 8
Trace this loop: Set count = 1. While count <= 4, print count and then add 1 to count. What numbers are printed?
- 9
A student writes this algorithm for brushing teeth: 1. Put toothpaste on brush. 2. Wet toothbrush. 3. Get toothbrush. 4. Brush teeth. Explain what is wrong and how to fix it.
- 10
Write the flowchart steps in words for this process: Start -> Input temperature -> If temperature >= 100 then Output Boiling, else Output Not boiling -> End.
- 11
An algorithm has these steps: Set total = 0. For each number in 2, 4, 6, add the number to total. Output total. What does the algorithm output?
- 12
Create a simple algorithm for a game character that has 3 lives. Each time the character hits an obstacle, it loses 1 life. The algorithm should repeat until lives = 0, then output Game over.
Related Cheat Sheets
More CS Worksheets
CS: Arrays and Lists
Grade 9-12 · 12 problems
CS: Big-O Notation and Algorithm Efficiency
Grade 9-12 · 12 problems
CS: Binary Numbers and Number Systems
Grade 6-8 · 12 problems
CS: Boolean Logic and Logic Gates
Grade 6-8 · 12 problems
More Grade 6-8 Worksheets
Ratios & Proportions
Math · 8 problems
Forces & Motion
Physics · 8 problems
Figurative Language
Language Arts · 8 problems
US Government & Civics
Social Studies · 8 problems