LESSON 14

GOAL: Students will be able to…

  1. Analyze a solution to a problem and explain why it works
  2. Use control structures to create general solutions that work on all Karel worlds

VOCAB:

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:

  1. REVIEW:
    1. Do 1.13.2 Control Structures Example Quiz
    2. What are the different ways we have been able to control Karel in the past week?
  2. Do Now: Get it from your teacher
  3. Share answers for the Do Now exercise from students and test their code in the editor of the Move Tennis Ball Stack example.
    1. What are the reasons why a particular control structure was chosen by students?
    2. If a student example contains bugs, inquire solutions from the class and test it together.
    3. Look at the correct solution. Take note that code was tested in increments.
  4. Watch 1.14.1 More Karel Examples and Testing
  5. Explore the 1.14.3 Move Tennis Ball Stack solution as well as the 1.14.4 Climbing Karel example.
  6. Teacher will show you a preview of Tower Builder exercise in the Karel Challenges section.
    1. What control structures you might use and in which order? Record your answer on the white board in the classroom.
  7. Be sure to use debugging strategies so that your code is reusable in all of Karel’s worlds.
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. 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):
    1.  When would you use each of the different control structures?
    2. Explain in your own words how to make Karel solve the Move Tennis Ball Stack problem.
    3. Explain in your own words how to make Karel solve the Climbing Karel problem.

Leave a comment

Your email address will not be published. Required fields are marked *