Course Content
Paper 2 – Problem Solving Approach -Practical
0/102
Past Paper-2 May/June 2025
Past Paper-1 May/June 2025
Download Files
0/1
Olevel : Computer Science 2210 / IGCSE 0478 : Recorded

Have you ever tried keeping track of your daily expenses, your classmates’ test scores, or even the names of your favorite movies? If you’ve ever written them down one by one, you’ve already used the idea behind arrays .you just didn’t call it that yet!

Today, we’re going to explore the concept of a one-dimensional array, and how arrays help us organize data efficiently. both in real life and in programming

Let’s start discussing

A 1D array, or one-dimensional array, is a collection of data items of the same type, stored in contiguous memory locations.

Think of it as a row of boxes — each box can hold one value, and each box has an address or position number called the index.

In pseudocode, if we create an array named “marks,” it might look like this:

DECLARE MARKS AS ARRAY STARTING FROM 1 TO 4 AS INTEGER EQUAL TO [10, 20, 40, 50] 

in python we will write it as 

marks = [10, 20, 40, 50]

Here, marks as per zero value is 10.marks as per one value is 20. and so on. The first element always starts with index 0.

Now let’s connect this with real life.

Think of lockers in a school hallway — each locker is numbered, and each one stores something.You can quickly find what’s inside Locker #5 by using its number.

That’s exactly how arrays work — you can access any item using its index instantly.

Or imagine train seats labeled Seat 1, Seat 2, Seat 3… Each seat number represents an index in an array of passengers!

In science experiments, arrays can represent temperature readings recorded over several days:

temperature = [28, 30, 27, 31, 29]

This makes it easy to calculate averages or identify the highest temperature.

Without arrays, you’d have to store, each value in a separate variable — like mark1, mark2, mark3… and so on. That’s messy and inefficient.

Arrays give structure.You can Store large amounts of data under one name.

Easily loop through values using programming statements like. for loops.

Perform operations like sorting, searching, and calculating totals quickly.

You cannot copy content of this page