Week 15: Small programs II
C# code typing course. 24 wpm, 94% accuracy.
Last week you typed a program line by line. This week you combine two structures: a loop that walks through a series of numbers, and a condition that checks each one as it goes. The program adds up the values it wants and prints the total. Programs like this put many symbols close together, so you need accuracy on every line and a steady rhythm between them.
What you will learn
In this week’s program, the loop and the condition work together. The loop visits each number in turn, and the condition decides what to do with it:
total += i;adds the value ofitototal. The+=is two symbols: a plus sign and an equals sign.if (number % 2 == 0)checks whether a number divides by two with no remainder. The==asks whether two values are equal.
This week introduces no new symbols. You use the ones from earlier weeks together: parentheses, plus, equals, percent and semicolons. If you need to check where one of them sits, return to its earlier lesson.
Technique tips
- Before you type, picture the program’s shape: first the variable, then the loop, then the condition, and last the output line.
- Type two-symbol pairs such as
==and+=as one smooth motion, with no gap between the symbols. - Close each block as soon as you open it in your mind. This matters even more when a condition sits inside a loop.
- Return to the home row after each symbol. Frequent returns keep your writing even.
- Enter fills in the next line’s indentation. Nested blocks already carry their indent forward, so trust Enter rather than retyping it.
Lessons
- Learn (10 to 15 minutes): Watch the demo of the two-symbol pairs, notice which ones use Shift, and type
+=and==several times. - Practice (10 to 15 minutes): Type this week’s small program from start to finish. Check the closing braces and semicolons on every line.
- Review (10 to 15 minutes): Take the two-minute test. Note which line slowed you down and focus on it in the next lesson.
This week’s goal
The goal this week is 24 WPM with 94 percent accuracy. Stars work like this: finish the lesson for 1 star, reach 94 percent accuracy for 2 stars, and reach 24 WPM as well for 3 stars. A missing closing brace inside a nested block changes how the whole program runs, so accuracy comes first. Speed follows as you become familiar with the program’s shape.
This week’s lessons
Do the lessons in order. Each one ends with a test, and your best result is saved.