A-level Computing/AQA/Problem Solving, Programming, Data Representation and Practical Exercise/Problem Solving/Algorithm design

Express the solution to a simple problem as an algorithm using flowcharts, pseudo-code or structured English and the standard constructs:

Sequence
performing or operating each step consecutively in the order they arise int main { // Read n   int n;    printf("Enter number n : "); scanf("%d", &n); // Declare sum to 0 // counter variable i to 1 int sum = 0; int i = 1; // loop to input n numbers // loop continues until i<=n for(i=1;i<=n;i++){ // read num int num ; printf("Enter number %d: ", i); scanf("%d", &num); // update sum to sum + num sum = sum + num; }   // print sum printf("Sum of given numbers is %d", sum); return 0; }
 * 1) include

Selection
Selection is choosing a step

Repetition
A sequence of steps that loop until a requirement is met