Week 14: Small programs I
C# code typing course. 23 wpm, 94% accuracy.
So far you have worked on individual symbols and patterns. This week you put them together into a small program. It asks the user for a name and then prints a greeting. A program like this uses parentheses, quotes, the plus sign, the equals sign and semicolons, often within a few lines. The goal is to get every line right and to keep a steady rhythm from one line to the next.
What you will learn
A small program is a short list of lines, and each line does one job. This week’s program shows a message, reads a line from the user and stores it in a variable, then prints a greeting:
Console.Write("Your name: ");
string name = Console.ReadLine();
Console.WriteLine("Hello " + name);
Console.Writeprints text and keeps the cursor on the same line.Console.WriteLineprints text and then moves to a new line.string name = Console.ReadLine();stores the line the user typed in a variable calledname.
This week introduces no new symbols. You use the ones from earlier weeks together: parentheses, quotes, plus, equals and semicolons. If you want to review where a symbol sits on the US English layout, return to its earlier lesson.
Technique tips
- Read the whole line once before you type it. Knowing where each symbol goes stops your hands from pausing mid-line.
- When you finish a line, glance at the next one before you type it. That keeps the flow of the program steady.
- Return to the home row after each symbol. Frequent returns keep the writing even.
- Enter fills in the next line’s indentation. This small program needs no manual indenting, so let Enter do the work.
Lessons
- Learn (10 to 15 minutes): Watch the demo of the three lines, say what each one does aloud, and type the program several times.
- Practice (10 to 15 minutes): Type the whole small program from start to finish. Check each line before moving to the next one.
- 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 23 WPM with 94 percent accuracy. Stars work like this: finish the lesson for 1 star, reach 94 percent accuracy for 2 stars, and reach 23 WPM as well for 3 stars. One wrong line stops the whole program from running, so get each line right before you chase speed. Your flow grows as the program becomes familiar.
This week’s lessons
Do the lessons in order. Each one ends with a test, and your best result is saved.