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
ifandelse, for exampleif (choice == 1). - Calculating with
+,-,*and/. - Printing the result with
printfand ending the program withreturn 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
ifandelseblock 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
- Lesson 1, learn (10 to 15 minutes): Review the symbols from earlier weeks. Type the calculator skeleton three times.
- Lesson 2, practice (10 to 15 minutes): Type the section that reads two numbers and chooses an operation. Check that every
ifandelseblock is complete. - 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.