LESSON 15

GOAL: Students will be able to…

  1. Explain why it is important to indent code
  2. Identify proper indentation
  3. Modify a program to have proper indentation
  4. Write programs with proper indentation

VOCAB:

Indentation Indentation is the visual structure of how your code is laid out. It uses tabs to organize code into a hierarchy.
Programming Style The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do 1.14.2 Quiz: Which Control Structure?
    2. Which is easier to read: indented code or unindented code?
    3. What are some things we can do in our code to have good programming style?
  2. Do Now: Get it from your teacher–Share your solutions with a partner to compare and contrast the various results.
    1. Think about English rules regarding indentation and new paragraphs.
    2. What purpose does indentation serve in reading and writing?
    3. How do these rules apply to programming?
  3. Watch  1.15.1 How to Indent Your Code
  4. Examine 1.15.3 Dance and Clean Karel. How can you use the gray dotted lines to guide your indentation?
  5. Work individually or in pairs to complete  1.15.4 Diagonal and 1.15.5 Staircase–SHOW ME
  6. 1.15.6 Karel Exercises Badge–Did you get it? SHOW ME
  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. How is indentation used in programs? What are the rules for proper indentation?
    2. Why is it important to use proper indentation?
    3. Why is good programming style important?
    4. Write pseudocode for either Diagonal or Staircase using correct indentation.

Leave a comment

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