Week 5: Comparison and logic
Small Basic code typing course. 14 wpm, 91% accuracy.
Programs often ask a question and then follow a different path depending on the answer. Is a number bigger? Are two values equal? Do two conditions both hold? Each of these questions is written with comparison and logic symbols. This week you learn six symbols and practice typing them on the right keys. Note that Small Basic does not use !, & or | for logic. It uses <> for not equal, and the words And and Or for logic. Comparisons use =, <, >, <=, >= and <>. You still practice !, & and | as typing drills.
What you will learn
This week has six symbols. On the US English layout:
<: , key + Shift (Shift with the left pinky). Right middle finger on the comma key.>: . key + Shift (Shift with the left pinky). Right ring finger on the period key.!: 1 key + Shift (Shift with the right pinky). Left pinky.=: = key, right pinky.&: 7 key + Shift (Shift with the left pinky). Right index finger.|: \ key + Shift (Shift with the left pinky). Right pinky.
Example:
If age >= 18 And ticket = "yes" Then
TextWindow.WriteLine("You may enter")
EndIf
The condition has two parts joined by And. The >= sign means greater than or equal to.
Technique tips
- Press Shift with your left pinky for
<and>. Keep your right hand steady and move only the finger that needs to reach. - The
!symbol sits on the left pinky side, so keep that finger ready when you type it. - Check
<and>after you type them by adding a space and reading the line back. This confirms which symbol you wrote. - Several symbols this week are typed with the left pinky. Keep your hand relaxed and balanced rather than tense.
- Enter fills in the indentation of the next line. Read the lines inside a condition with their indentation to see where each block begins.
Lessons
- Lesson 1, 10 to 15 minutes: Learn the six symbols. Watch the keyboard demo and type each symbol three times.
- Lesson 2, 10 to 15 minutes: Write
Iflines with a comparison, the<>operator and theAndkeyword. - Lesson 3, 10 to 15 minutes: Review what you practiced, then take the 2-minute test.
This week’s goal
The targets are 14 wpm and 91% accuracy. Finishing the lessons earns one star. Reaching 91% accuracy earns the second star. The third star also needs 14 wpm. Mixing up < and > changes what a program does, so accuracy comes first.
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.