GOAL: Students will be able to…
- Analyze a solution to a problem and explain why it works
- Use control structures to create general solutions that work on all Karel worlds
|Break Down (Decompose)||Breaking down (decomposing) your code is splitting it into more functions.|
|Read Like a Story||Programs that “Read like a story” have good decomposition and make the code easy to follow.|
|Decomposition||Decomposition is breaking your program into smaller parts.|
|Control Structure||A control structure lets us change the flow of the code.|
|Fencepost Problem||A problem when using a while loop where you forget one action at the beginning or the end.|
DO THE FOLLOWING IN ORDER:
- Do 1.13.2 Control Structures Example Quiz
- What are the different ways we have been able to control Karel in the past week?
- Do Now: Get it from your teacher
- Share answers for the Do Now exercise from students and test their code in the editor of the Move Tennis Ball Stack example.
- What are the reasons why a particular control structure was chosen by students?
- If a student example contains bugs, inquire solutions from the class and test it together.
- Look at the correct solution. Take note that code was tested in increments.
- Watch 1.14.1 More Karel Examples and Testing
- Explore the 1.14.3 Move Tennis Ball Stack solution as well as the 1.14.4 Climbing Karel example.
- Teacher will show you a preview of Tower Builder exercise in the Karel Challenges section.
- What control structures you might use and in which order? Record your answer on the white board in the classroom.
- Be sure to use debugging strategies so that your code is reusable in all of Karel’s worlds.
- FYI: CodeHS Online Textbook–use this as a resource
- BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
- When would you use each of the different control structures?
- Explain in your own words how to make Karel solve the Move Tennis Ball Stack problem.
- Explain in your own words how to make Karel solve the Climbing Karel problem.