# Loops: For vs While > Tenth graders learn the two main kinds of loops — for loops that repeat a known number of times, and while loops that repeat until a condition changes — and… **Computer Science** | **Grade 10** *A free lesson plan from K12 Academics. Source page: https://lessonplans.k12academics.com/k12-lesson-g10-cs-loops.html* Tenth graders learn the two main kinds of loops — for loops that repeat a known number of times, and while loops that repeat until a condition changes — and how to choose the right one for a task. **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… - Explain **for loops**. - Explain **while loops**. - Choose the right **loop**. - Use loops in code. All loops repeat code — but a FOR loop and a WHILE loop are used in different situations. When do you use each one? ## For Loop or While Loop? Project this and sort each task by whether a FOR loop or a WHILE loop fits best. ## 50 minutes, five moves Tap any phase to open the teacher moves and student actions. ### Hook — Two Kinds of Loops All loops repeat — but when do you use FOR vs WHILE? #### 👩‍🏫 Teacher Moves - Show both loop types. - Ask when to use each. - Set the goal. #### 🎒 Student Actions - See them. - Wonder. - Predict. ### Unplugged — Unplug It Students practice. #### 👩‍🏫 Teacher Moves - Act out a for loop (fixed count). - Act out a while loop (condition). - Feel the difference. #### 🎒 Student Actions - Count it. - Wait for it. - Feel it. ### Use — For or While Students use. #### 👩‍🏫 Teacher Moves - Send students to For Loop or While Loop? - Sort each task. - Explain them. #### 🎒 Student Actions - Sort them. - Explain. - Check. ### Modify — Rewrite It Students modify. #### 👩‍🏫 Teacher Moves - Rewrite a for loop as a while loop. - Predict the result. - Explain the choice. #### 🎒 Student Actions - Rewrite. - Predict. - Explain. ### Create — Create Students conclude. #### 👩‍🏫 Teacher Moves - Write a for and a while loop. - Explain when each fits. - Complete the exit ticket. #### 🎒 Student Actions - Write them. - Explain. - 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. Use control structures including loops. Design and iterate programs with loops. Decompose problems into repeated steps. Computational Thinker. ## One lesson, every learner ### Multilingual Learners - Loop-type task cards. - Sentence frame: “Use a ___ loop when ___.” - Act out loops. ### Support & Access - Start with fixed-count vs. until. - Sort one at a time. - Use examples. ### Stretch & Extend - Write nested loops. - Explain infinite loops. - Use loops with lists. ### What to gather - 📽️Projector / board - 🔁Loop task cards - 💻For Loop or While Loop? - 💻Coding tool - ✏️Pens - 🎫Exit-ticket slips ### Key terms - **loop**: code that repeats - **for loop**: repeats a known number of times - **while loop**: repeats until a condition changes - **condition**: a true/false test - **iteration**: one pass through a loop - **counter**: a variable that counts loops - **infinite loop**: a loop that never stops - **control structure**: code that directs the flow ## Exit Ticket Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students. ### Create: pick the loop. Have students write two short tasks — one for a for loop and one for a while loop — and explain why each fits. A printable loops sheet is in the Computer Science library. ## Check your understanding **1. What does “loop” mean?** - repeats a known number of times - a true/false test - code that repeats *(correct)* - code that directs the flow “loop” means: code that repeats **2. Which word means: “repeats a known number of times”?** - for loop *(correct)* - counter - loop - infinite loop “for loop” means: repeats a known number of times **3. What does “while loop” mean?** - a variable that counts loops - repeats until a condition changes *(correct)* - repeats a known number of times - a loop that never stops “while loop” means: repeats until a condition changes **4. Which word means: “a true/false test”?** - condition *(correct)* - iteration - for loop - counter “condition” means: a true/false test **5. What does “iteration” mean?** - a true/false test - repeats a known number of times - a variable that counts loops - one pass through a loop *(correct)* “iteration” means: one pass through a loop **6. Which word means: “a variable that counts loops”?** - for loop - loop - control structure - counter *(correct)* “counter” means: a variable that counts loops ## Printable worksheet --- Full lesson page: https://lessonplans.k12academics.com/k12-lesson-g10-cs-loops.html All lessons: https://lessonplans.k12academics.com/