Computer Science · Coding Basics

Thinking Like a Computer

Computers are super fast but not clever — they do exactly what you say. So we give them an algorithm: clear steps in the right order.
🤖An Algorithm Is a Set of Steps
INPUT bread, PB & jelly PROCESS · do steps in order 1 open the bread 2 spread the peanut butter 3 add jelly, close it up OUTPUT 🥪
🔢Sequence: Order Matters!
Right order
1Get two slices of bread
2Spread peanut butter on one
3Spread jelly on the other
4Press the slices together
🥪A yummy sandwich!
🐞Wrong order = a bug
1Press the slices together
2Spread jelly… on the outside?
3Put the whole PB jar on top
4Get the bread (too late!)
🤖A sticky mess — a bug!
PSEUDOCODE
1GET 2 slices of bread2SPREAD peanut butter on slice A3SPREAD jelly on slice B4PUT slice A onto slice B5SHOW "Sandwich is ready!" 🥪
🔧Bugs & Debugging
▶️ 🔍 🐞 🔧 DE- BUG
🔁 Find it, fix it, run it again!
▶️ Run the program and watch what it does
🔍 Spot the bug — which step went wrong?
🐞 The bug is the mistake in your steps
🔧 Fix it and run again — that's debugging!
🔑Key Terms
📋Algorithm A list of steps to finish a task or solve a problem.
🔢Sequence The exact order in which steps or events happen.
🐞Bug An error in a program that stops it working right.
🔧Debug To find and fix the bugs in a program.
💾Program An algorithm coded so a machine can run it.
📝Pseudocode Plain-English steps that describe an algorithm before you code it.
Remember: a computer does exactly what you tell it — so write your algorithm in the right order, then debug any steps that go wrong!
✏️ Computer Science Anchor Chart · Thinking Like a Computer
From ClickClass — hundreds of free printables at clickclassedu.com/printables