Week 4: Arithmetic operators
Small Basic code typing course. 14 wpm, 91% accuracy.
Calculations sit at the heart of most programs. A total, a counter or an average is written with signs such as plus, minus, times and divide. This week you learn six symbols and practice typing each one on the right key. There is one detail to know: the percent sign % is not used as an operator in Small Basic. To find a remainder, you use the Math.Remainder function instead. You will type % this week as a typing drill.
What you will learn
This week has six symbols. On the US English layout:
+: = key + Shift, opposite pinky. Right pinky.-: - key, right pinky.*: 8 key + Shift, opposite pinky. Right middle finger./: / key, right pinky.=: = key, right pinky.%: 5 key + Shift, opposite pinky. Left index finger.
Example:
total = 7 + 5 * 2
remainder = Math.Remainder(17, 5)
The first line stores 17 in total. The second line divides 17 by 5 and stores the remainder, which is 2.
Technique tips
- Choose each key calmly. Hitting the right key first and gaining speed later works best.
- Press Shift for
+and%with the opposite pinky. - The
*and-symbols share the same reach area for the right pinky. Stretch out and come back without sliding your whole hand. - Spaces make code easier to read, for example
total = 7 + 5. Treat each space as a key you must press on purpose. - After you write a calculation, print the result and check it. Catching a mistake early saves a lot of time.
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 short lines that use addition, multiplication and
Math.Remainder. - 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. A wrong symbol changes the whole result, 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.