# How a Program Runs > Seventh graders learn the path code takes to become a running program - writing it, saving it, the computer translating it into instructions it understands, running those step by step, and showing the output - and put the steps in order. **Computer Science** | **Grade 7** *A free lesson plan from K12 Academics. Source page: https://lessonplans.k12academics.com/k12-lesson-g7-cs-how-a-program-runs.html* Seventh graders discover that the code they write is not what the computer runs directly, and trace how a program goes from typed text to translated instructions to a result on screen, then put the steps in order. **Copy link** works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment. ## Everything you need before the bell rings ### Learning Objectives Students will be able to… - See how code **becomes a program**. - Know code must be **translated**. - Follow the **run**. - Order the steps. You type code in words people can read, but a computer only understands simple on-off instructions. What has to happen between pressing run and seeing a result? ## Order the Steps Project this and put the steps of running a program in order — tap each one from writing the code to showing the output. ## 50 minutes, five moves Tap any phase to open the teacher moves and student actions. ### Hook — From Typing to Running You type code in words a person can read, but a computer only understands simple on-off instructions. So what has to happen between pressing run and seeing a result? #### 👩‍🏫 Teacher Moves - Show a line of code and its output. - Ask what happens between. - Set the goal. #### 🎒 Student Actions - Think. - Share. - Get ready. ### Use — Order the Steps Students put the steps of running a program in order. #### 👩‍🏫 Teacher Moves - Send students to Order the Steps. - Order the steps. - Name each one. #### 🎒 Student Actions - Order. - Say. - Note it. ### Modify — Who Does What Students name what handles each step. #### 👩‍🏫 Teacher Moves - Pick a step. - Say who or what does it. - Say what it produces. #### 🎒 Student Actions - Pick. - Say. - Say. ### Create — My Run Map Students diagram the journey. #### 👩‍🏫 Teacher Moves - Draw code, translator, and output. - Add arrows for each step. - Label where translation happens. #### 🎒 Student Actions - Draw. - Add. - Label. ### Reflect — Code to Result Students reflect on running a program. #### 👩‍🏫 Teacher Moves - Why must code be translated before it runs? - What is the last step a program does? - Complete the exit ticket. #### 🎒 Student Actions - Say it. - Say it. - Complete the exit ticket. ## Built to the standards you report on Aligned to the CSTA K-12 Computer Science Standards and ISTE Standards for Students. Decompose problems and describe how a program is created and run. Systematically test and refine programs. Explain how programs run on computing systems. Computational Thinker: model how a system turns input into output. ## One lesson, every learner ### Multilingual Learners - Step picture cards. - Sentence frame: “First ___ , then ___ .” - Order two steps at a time. ### Support & Access - Start with writing and saving. - Match each step to a tool. - Add one step at a time. ### Stretch & Extend - Compare a compiler and an interpreter. - Trace a real one-line program. - Explain where a bug could stop the run. ### What to gather - 📽️Projector / board - 🖼️Program-step cards - 💻Order the Steps - 📜A sample code snippet - ✏️Pencils - 🎫Exit-ticket slips ### Key terms - **program**: a set of instructions written for a computer - **code**: the instructions a programmer writes in a language - **programming language**: the words and rules used to write code - **translate**: to turn code into instructions the computer understands - **compiler**: a tool that translates all the code at once before running - **interpreter**: a tool that translates and runs code line by line - **run**: to carry out the instructions of a program - **output**: the result a program produces ## Exit Ticket Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students. ### Create: my run map. Have students draw the code, the translator, and the output, add arrows for each step, and label where translation happens, so the hidden process becomes visible. A printable how-a-program-runs worksheet is in the Computer Science library. ## Check your understanding **1. What does “program” mean?** - a set of instructions written for a computer *(correct)* - the instructions a programmer writes in a language - the words and rules used to write code - to turn code into instructions the computer understands “program” means: a set of instructions written for a computer **2. Which word means: “the instructions a programmer writes in a language”?** - program - code *(correct)* - programming language - translate “code” means: the instructions a programmer writes in a language **3. What does “programming language” mean?** - a set of instructions written for a computer - the instructions a programmer writes in a language - the words and rules used to write code *(correct)* - to turn code into instructions the computer understands “programming language” means: the words and rules used to write code **4. Which word means: “to turn code into instructions the computer understands”?** - program - code - programming language - translate *(correct)* “translate” means: to turn code into instructions the computer understands **5. What does “compiler” mean?** - a tool that translates all the code at once before running *(correct)* - a set of instructions written for a computer - the instructions a programmer writes in a language - the words and rules used to write code “compiler” means: a tool that translates all the code at once before running **6. Which word means: “a tool that translates and runs code line by line”?** - program - interpreter *(correct)* - code - programming language “interpreter” means: a tool that translates and runs code line by line ## Printable worksheet --- Full lesson page: https://lessonplans.k12academics.com/k12-lesson-g7-cs-how-a-program-runs.html All lessons: https://lessonplans.k12academics.com/