Skip to content

Latest commit

 

History

History
53 lines (42 loc) · 3.33 KB

File metadata and controls

53 lines (42 loc) · 3.33 KB

Lesson 2: Control Flow and Collections

In the prep work for this lesson, the students learned:

  1. The C# syntax for conditionals and loops:
    1. if, else, if/else
    2. switch statements
    3. for, while, and do...while
    4. break and continue statements
  2. How and when to use list, array, and dictionary collections.

Announcements

  1. Check with your class Candidate Engagement Manager for any other announcements.

Part-Time Students

  1. Remind students that Graded Assignment #1 is due soon! They should be able to complete it after today's class.

Full-Time Students

  • Welcome to Day 2!
  • Lesson 2
  • Leave time in the afternoon to introduce Assignment 1
  1. Graded Assignment #1 is open! With each of the graded assignments in this unit, the key is to read through everything carefully and start on what you can do as soon as possible. In class, read through the instructions with your students and highlight what they are capable of doing after this class.
  • Schedlued work days for Assignment 1
    • Day 6, and Day 7
  • Assignment 1 due by end of Day 8

Large Group Time (Instructor)

Lesson 2 Topics That Require Careful Attention

  1. Encouragement: Point out that learning a second coding language is usually easier than learning the first. The students already know how to use loops and conditionals, so applying them in C# is just a matter of recognizing the different syntax.
    1. Ask the class to give some examples of similarities or differences for conditionals and loops in C# vs. other coding languages.
  2. The fallthrough aspect of switch statements is not always obvious and should be reviewed. However, do not sink too much time into this, since the students will use if/else statements much more often than switch.
  3. Ask the students to explain the difference between while and do...while loops.
  4. Review how to use break and continue statements within loops.
  5. Review foreach loops in the context of array and list collections. Note how the syntax changes when applied to dictionaries.
  6. As much as possible, live-code examples for lists and dictionaries, including how to use the most common methods.

Lesson 2 Studio (TA Notes)

  1. With your group, discuss the "Some Items to Ponder Before Starting" section of the studio instructions.
  2. Remember to check in with EVERY student during the studio time.
    1. Ask them detailed questions about studio 1 if they did not finish it before the end of the last class.
    2. As they code studio 2, ask them to explain what different portions of their code does.
  3. Common mistakes:
    1. Not properly setting up the Main method.
    2. Forgetting to import the necessary classes (e.g. List).
    3. Even though dictionaries are the better option, many students will try to use arrays or lists because they see them as being easier. While the students could make these collections work, be prepared to talk about the differences between the different types of collections and why dictionaries would be the better option.
  4. Be sure to do a visual check of your students' code.
  5. For the students who finish early, ask guided questions to encourage them to try one or more of the bonus tasks (e.g. "How could you modify your code to count 'a' and 'A' as the same letter?").
  6. Remind your students to push their work up to GitHub when they finish the studio.