Computer Science - 0478 CIE

Arrays

Akopọ

Imagine storing the marks of 100 students in 100 separate variables, then trying to add them up. It would be unbearable. An array solves this by holding many values of the same type under a single name, each reachable by a number called its index, so a short loop can sweep through them all.

In this lesson you will learn to declare and use one-dimensional and two-dimensional arrays in the Cambridge pseudocode style, understand why arrays are so useful, and write values into and read values from an array using iteration, with full worked routines you can adapt in the exam.

Awọn Afojusun

  1. 1 Declare and use one-dimensional (1D) and two-dimensional (2D) arrays
  2. 2 Understand the use of arrays
  3. 3 Write values into, and read values from, an array using iteration

Akọ̀wé Ẹ̀kọ́

Almost every real program handles lists of data: scores, names, prices, pixels. Arrays are the basic structure for storing such lists, and the programming paper expects you to declare them, put data in, take data out, and process them with loops. Master the array-and-loop pattern and a whole class of problems becomes routine.

O wa lori ohun elo Green Bridge

Gba ohun elo Green Bridge CBT sori foonu tabi kọmputa rẹ lati ri awọn akọsilẹ ẹkọ ni kikun, awọn ibeere adaṣe, ati diẹ sii.

Awọn akọsilẹ ẹkọ ni kikun pẹlu awọn aworan apejuwe
Oluranlọwọ ẹkọ ti AI ṣe agbara rẹ
Kọ ẹkọ laisi intanẹẹti, nigbakugba, nibikibi
O wa lori Android, Windows, macOS, ati Linux

Ìdánwò Ẹ̀kọ́

Oriire fun ipari ẹkọ lori Arrays. Ni bayi ti o ti ṣawari naa awọn imọran bọtini ati awọn imọran, o to akoko lati fi imọ rẹ si idanwo. Ẹka yii nfunni ni ọpọlọpọ awọn adaṣe awọn ibeere ti a ṣe lati fun oye rẹ lokun ati ṣe iranlọwọ fun ọ lati ṣe iwọn oye ohun elo naa.

Iwọ yoo pade adalu awọn iru ibeere, pẹlu awọn ibeere olumulo pupọ, awọn ibeere idahun kukuru, ati awọn ibeere iwe kikọ. Gbogbo ibeere kọọkan ni a ṣe pẹlu iṣaro lati ṣe ayẹwo awọn ẹya oriṣiriṣi ti imọ rẹ ati awọn ogbon ironu pataki.

Lo ise abala yii gege bi anfaani lati mu oye re lori koko-ọrọ naa lagbara ati lati ṣe idanimọ eyikeyi agbegbe ti o le nilo afikun ikẹkọ. Maṣe jẹ ki awọn italaya eyikeyi ti o ba pade da ọ lójú; dipo, wo wọn gẹgẹ bi awọn anfaani fun idagbasoke ati ilọsiwaju.

  1. What must be true of all the items stored in one array? A. they must be integers B. they must be the same data type C. they must be strings D. they must be unique Answer: B
  2. What is used to identify the position of an element in an array? A. its value B. its data type C. its index D. its identifier Answer: C
  3. Which declaration creates a 1D array of 8 integers indexed 1 to 8? A. DECLARE A : INTEGER B. DECLARE A : ARRAY[1:8] OF INTEGER C. DECLARE A : ARRAY OF 8 D. DECLARE A[8] Answer: B
  4. Which loop structure is normally used to process every element of a 2D array? A. a single WHILE loop B. a REPEAT loop C. a nested (loop inside a loop) D. no loop is needed Answer: C
  5. Before adding all elements of an array into a variable Total, Total should first be: A. set to the first element B. set to 0 C. left undeclared D. set to the array length Answer: B

O wa lori ohun elo Green Bridge

Gba ohun elo Green Bridge CBT sori foonu tabi kọmputa rẹ lati ri awọn akọsilẹ ẹkọ ni kikun, awọn ibeere adaṣe, ati diẹ sii.

Awọn akọsilẹ ẹkọ ni kikun pẹlu awọn aworan apejuwe
Oluranlọwọ ẹkọ ti AI ṣe agbara rẹ
Kọ ẹkọ laisi intanẹẹti, nigbakugba, nibikibi
O wa lori Android, Windows, macOS, ati Linux

O wa lori ohun elo Green Bridge

Gba ohun elo Green Bridge CBT sori foonu tabi kọmputa rẹ lati ri awọn akọsilẹ ẹkọ ni kikun, awọn ibeere adaṣe, ati diẹ sii.

Awọn akọsilẹ ẹkọ ni kikun pẹlu awọn aworan apejuwe
Oluranlọwọ ẹkọ ti AI ṣe agbara rẹ
Kọ ẹkọ laisi intanẹẹti, nigbakugba, nibikibi
O wa lori Android, Windows, macOS, ati Linux

Ṣe Adaṣe Awọn Ibeere Idanwo Adaṣe

Ṣe o fẹ ṣe adaṣe awọn ibeere idanwo adaṣe nipa Arrays? Ṣe igbasilẹ ohun elo Green Bridge CBT lati wọle si awọn ibeere idanwo adaṣe ati awọn ayẹwo adaṣe kikun fun koko-ọrọ yii.

Ṣe igbasilẹ ohun elo naa lori Google Playstore

Gbogbo ohun ti o nilo lati ṣe dara julọ ninu JAMB, WAEC ati NECO.

Green Bridge CBT Mobile App
Asiko ẹkọ AI ti ara ẹni Chat Assistant
Ẹgbẹẹgbẹrun Awọn Ibeere Atijọ JAMB, WAEC & NECO
Fiwọn 1200 Awọn akọsilẹ Ẹkọ ju.
Atilẹyin Aisinipo - Kọ ẹkọ Nigbakugba, Nibi gbogbo
Tẹ̀dí Green Bridge
Àkójọpọ̀ Ìtàn Lítíréṣọ̀ & Ìbéèrè Tó Lè Dáyéé ṣẹ́lẹ̀
Tẹle iṣẹ ṣiṣe rẹ ati ilọsiwaju rẹ.
Àlàyé tí ó jinlẹ̀ fún ìmòye tó jinlẹ̀.