Year 10 IGCSE Computer Science

24th November 2023

Programming and Problem Solving

Programming and Problem Solving is an integral part of the IGCSE Computer Science Course. The skills learnt, though challenging, are a fundamental part of this STEM subject. The Year 10 students have worked very hard this year to master these skills. Read on to find out our students' explanations of some of the key aspects of Programming and Problem Solving.

Totaling, Counting and Averages by Ernest Y10

In Year 10 we have been looking at programming and problem solving and one of the topics in programming and problem solving is totaling, counting and averages and I am going to give you a brief explanation on what these things are.

Totaling

Totaling is used to sum up all the numbers in a list

The code for this is Total<—total+number

You can use this in python code, pseudocode and flowchart

Counting

Counting is used to find how many numbers are there in a list. Counting can keep track of how many irritations your program has performed in a loop.

The code is count<— count+1

Averages

Average, which is the arithmetic mean, and is calculated by adding a group of numbers and then dividing by the count of those numbers. For example, the average of 2, 3, 3, 5, 7, and 10 is 30 divided by 6, which is 5.

The code is average<— Total / count

Functions by Fidel Y10

What are functions? In computer science, a function is a fundamental concept that refers to a named sequence of instructions or statements that perform a specific task. Functions are used to organise code into manageable and reusable units.

Examples

def calculate_string_length(input_string):

length = len(input_string)

return length

string_length = calculate_string_length("Hello, World!")

print(string_length) # Output: 13

def find_maximum(a, b):

return max(a, b)

max_value = find_maximum(8, 12)

print(max_value) # Output: 12

Iteration by Ana Y10

Iterations are basically loops used in programming. You can represent loops in the form of pseudocode, python, and flowcharts. There are three loops we use. Repeat Until, Count Controlled(aka For Loop), and While Loop. Repeat until only exists in pseudocode and cannot be used/represented in python. 

Repeat Until:

  • Repeat until is a post condition loop that exits when true, meaning the form of repetition will check the conditions after the commands have been executed and exit the loop when the condition is true. 
  • It is a one trip loop which means it can loop from one to any number.

While Loop:

  • The While loop is a pre condition loop that exits when the condition is false. The condition is checked before the commands are executed and will exit the loop when the condition is false. 
  • It is a zero trip loop and can loop zero-many times.

Count Controlled Loop: 

  • The For loop has a definite amount of times it loops (therefore, count controlled).
  • It has a definite start and stop and will increase automatically. 

Examples of Each Loop in Pseudocode:

Problem: Count from 1 to 10

  • Repeat Until;

//Counting

DECLARE Count: INTEGER

Count ← 0

REPEAT

Count ← Count + 1

OUTPUT Count

UNTIL Count = 10

  • While Loop;

//Counting

DECLARE Count: INTEGER

Count ←0

WHILE Count <10 DO

Count ←Count + 1

OUTPUT Count

ENDWHILE

  • For Loop;

//Counting

DECLARE Count: INTEGER

Count ← 0

FOR Count ←1 TO 10

OUTPUT Count

NEXT Count

Examples of Each Loop in Python: 

  • While Loop;

#Counting

#DECLARE Count: INTEGER

Count=0

while count <10:

count = count + 1

print(count)

  • For Loop;

#Counting

#DECLARE Count: INTEGER

for count in range(1,10): 

print(count)

Mr Took

The Independent Association of Prep Schools
Association of International Schools in Africa
GL Education Assessment Excellence
Independent Schools Inspectorate
Council of British International Schools (Accredited Member)
Kenyan International Schools Association
Council of British International Schools