Week 16: Final project

C code typing course. 25 wpm, 95% accuracy.

This week you have a final project: a small calculator that reads two numbers, picks one of four operations, and prints the result. You learn no new symbols. Instead, you bring together the +, -, * and / operators and the if, else, scanf and printf structures you practiced before. When you finish this project, you will have worked through all sixteen weeks of the course.

What you will learn

There are no new symbols. Your project combines these parts:

  • Reading two numbers with scanf.
  • Choosing an operation with if and else, for example if (choice == 1).
  • Calculating with +, -, * and /.
  • Printing the result with printf and ending the program with return 0.

Divide the project into sections. First read the numbers, then choose the operation, and finally print the result. After you write each section, look at the screen and check it before you start the next one.

Technique tips

  • Break the project into small parts and take a short pause after each one. Bring your hands back to the home row before you start again.
  • Type the parentheses and braces of each if and else block together. Do not move on to the next operation until the block is closed.
  • On long lines, check the numbers and operators one by one. The * and / symbols are easy to overlook, so look at them twice.
  • Enter gives you the right indentation automatically. Good indentation makes it much easier to find a mistake later.

Lessons

  1. Lesson 1, learn (10 to 15 minutes): Review the symbols from earlier weeks. Type the calculator skeleton three times.
  2. Lesson 2, practice (10 to 15 minutes): Type the section that reads two numbers and chooses an operation. Check that every if and else block is complete.
  3. Lesson 3, review (10 to 15 minutes): Take the two-minute test and type the result lines of the project. Save your result and practice the lines that gave you trouble.

This week’s goal

This week’s target is 25 WPM and 95% accuracy. Finishing the week’s lessons earns you 1 star. Reach 95% accuracy for 2 stars, and also reach 25 WPM for 3 stars. Every symbol in the final project matters, so build your speed on top of accurate typing.

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

    Keywords

    12 minutes

    Start
  2. Lesson 2: Practice

    Practice

    12 minutes

    Start
  3. Lesson 3: Review and test

    Review and test

    13 minutes

    Start

All weeks