Week 13: Data structures
C# code typing course. 22 wpm, 94% accuracy.
A list keeps values in order, while a dictionary pairs each value with a key. You might store a student’s name as the key and their score as the value. These structures are usually written with curly braces, colons and periods, often across several lines. This week you practice those three symbols in their correct places,
What you will learn
A dictionary holds key and value pairs. Inside the curly braces, each pair is written in its own braces and separated from the next by a comma:
var scores = new Dictionary<string, int>
{
{ "Ali", 90 },
};
new Dictionary<string, int>creates a dictionary whose keys are text and whose values are whole numbers.scores.Countgives the number of pairs in the dictionary. The period lets you reach that property.- Colons also appear in class declarations such as
class Student : Person, which you will meet in later lessons.
This week’s symbols on the US English layout:
{: press [ with Shift. Hold Shift with the opposite pinky (the left pinky) and press [ with the right pinky.}: press ] with Shift. Hold Shift with the opposite pinky (the left pinky) and press ] with the right pinky.:: press ; with Shift. Hold Shift with the opposite pinky (the left pinky) and press ; with the right pinky..: press the . key with the right ring finger.
Technique tips
- Plan the braces before you type a block. Know where the opening and closing pair sits, then fill in the entries.
- Press Shift before the curly brace and colon keys and keep it held until the key is down. Release the key first, then Shift.
Lessons
- Learn (10 to 15 minutes): Watch the demo for the four symbols, notice which ones need Shift, and type the dictionary block several times.
- Practice (10 to 15 minutes): Type this week’s data structure lines. Check that every key and value pair has its braces and comma.
- Review (10 to 15 minutes): Take the two-minute test. Note which symbol slowed you down and focus on it in the next lesson.
This week’s goal
The goal this week is 22 WPM with 94 percent accuracy. Stars work like this: finish the lesson for 1 star, reach 94 percent accuracy for 2 stars, and reach 22 WPM as well for 3 stars. A missing brace breaks the whole block, so get the structure right before speed.
Symbols this week
The colored keys are the ones you learn this week. The color shows which finger presses the key.
This week’s lessons
Do the lessons in order. Each one ends with a test, and your best result is saved.