Week 11: Lists and arrays

C code typing course. 20 wpm, 93% accuracy.

An array holds several values of the same type under one name. Its items sit between curly braces and are separated by commas. In C, the first item has the index 0, and the last index is one less than the number of items. This week you learn to type [, ] and , on the US English layout, and you practice reading items by their index.

What you will learn

On the US English layout:

  • [: the [ key, with your right pinky.
  • ]: the ] key, with your right pinky.
  • ,: the , key, with your right middle finger.

A line that declares an array of three grades:

int grades[3] = {90, 85, 70};

The first grade is read with grades[0], and that gives 90.

Technique tips

  • When you type [, close it right away, then fill in the number. This way the grades[ part and the closing ] stay easy to check.
  • Keep your right pinky steady for both brackets, and keep the rest of your fingers on the home row.
  • Put a space after each comma in the list of values. The spacing makes it obvious where each item starts.
  • Check the screen. Make sure the closing brace at the end of the declaration is there before you move on.

Lessons

  1. Lesson 1, learn (10 to 15 minutes): Watch the [, ] and , keys on the keyboard demo. Type each symbol five times.
  2. Lesson 2, practice (10 to 15 minutes): Type grades[0], grades[1] and grades[2]. Then type the three-item declaration from the example.
  3. Lesson 3, review (10 to 15 minutes): Take the two-minute test with array lines. Save your result and practice the brackets you got wrong.

This week’s goal

This week’s target is 20 WPM and 93% accuracy. Finishing the week’s lessons earns you 1 star. Reach 93% accuracy for 2 stars, and also reach 20 WPM for 3 stars. A wrong number inside the brackets makes the program read a different item, so type each index carefully.

Symbols this week

The colored keys are the ones you learn this week. The color shows which finger presses the key.

` ~ 1 ! 2 @ 3 # 4 $ 5 % 6 ^ 7 & 8 * 9 ( 0 ) - _ = + Backspace Tab Q W E R T Y U I O P [ { ] } \ | Caps A S D F G H J K L ; : ' " Enter Shift Z X C V B N M , < . > / ? Shift Ctrl Win Alt Alt Gr Win Menu Ctrl

This week’s lessons

Do the lessons in order. Each one ends with a test, and your best result is saved.

  1. Lesson 1: Learn

    New symbols: [ ] ,

    12 minutes

    Start
  2. Lesson 2: Practice

    Practice

    12 minutes

    Start
  3. Lesson 3: Review and test

    Review and test

    12 minutes

    Start

All weeks