Programming Fundamentals

Tutorial Overview:

Part 1: Calculating Values in Programs (5 mins)

Objectives: Understand the different types of operators, and how to use them.

In this short section, we will review what tools we have for doing mathematics in our programs. This section will be completed quickly, to make sure we have time for the rest of the tutorial.

Part 2: Weird Data Types and Arithmetic (10 mins)

In this short section, we will review how you can store values in programs.

These are short arithmetic expressions we will use during this tutorial:

Part 3: Diagramming (20 mins)

Objectives: Understand Flowcharts, and how to use them to break down a problem.

In this section, we'll work on diagramming a small program.

Flow Charts:

We'll start by discussing the following flowchart:
a diagram

Leap Years:

The three rules of a leap year may help with this activity:

Part 4: Practical Programming Exercise (rest of tutorial)

Objectives: Utilising Flowcharts and pseudocode to plan a program.

In this activity, you'll be writing the following program.

It should:

The following (unrelated) example of "pseudocode" might be useful for this activity:

// C style pseudocode example.
// Prints out "Hurrah!" if the entered number is 5

int n = 0
print "Enter a number"
scan a number into n
if (n == 5) {
    print "Hurrah!"
}