Counting Up

Line: Intro Line
Easy Sequence Learning Outcome One Walkthrough
Type: Walkthrough
You should have completed: Basic Comments This topic leads to: Welcome Message

Summary

This exercise demonstrates basic data processing (in this case adding up) and reinforces that lines of code execute in sequence one after the other.

Task

  1. Create a new console application
  2. Within "main" type in the following code
    code snippet
  3. Run the program, check that the calculations are correct and that the messages occur in the same order as in the code.

Questions

  1. How would you alter this code to add up the numbers 2.2, 4.7 and 6.3?
  2. Have you remembered to comment your code?