Computer Science - 0478 CIE

Arrays

Gbogbo ọrọ náà

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.

Ebumnobi

  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ọmọ Ojú-ẹ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.

Ọ dị na ngwa Green Bridge

Budata ngwa Green Bridge CBT na ekwentị maọbụ kọmputa gị iji nweta akwụkwọ ndụmọdụ zuru oke, ajụjụ mmụta, na ndị ọzọ.

Akwụkwọ ndụmọdụ zuru oke nwere eserese
Onye inyeaka mmụta AI
Mụọ n'ụzọ na-enweghị ịntaneti, oge ọbụla, ebe ọbụla
Ọ dị na Android, Windows, macOS, na Linux

Ayẹwo Ẹkọ

Ekele diri gi maka imecha ihe karịrị na Arrays. Ugbu a na ị na-enyochakwa isi echiche na echiche ndị dị mkpa, ọ bụ oge iji nwalee ihe ị ma. Ngwa a na-enye ụdị ajụjụ ọmụmụ dị iche iche emebere iji kwado nghọta gị wee nyere gị aka ịmata otú ị ghọtara ihe ndị a kụziri.

Ị ga-ahụ ngwakọta nke ụdị ajụjụ dị iche iche, gụnyere ajụjụ chọrọ ịhọrọ otu n’ime ọtụtụ azịza, ajụjụ chọrọ mkpirisi azịza, na ajụjụ ede ede. A na-arụpụta ajụjụ ọ bụla nke ọma iji nwalee akụkụ dị iche iche nke ihe ọmụma gị na nkà nke ịtụgharị uche.

Jiri akụkụ a nke nyocha ka ohere iji kụziere ihe ị matara banyere isiokwu ahụ ma chọpụta ebe ọ bụla ị nwere ike ịchọ ọmụmụ ihe ọzọ. Ekwela ka nsogbu ọ bụla ị na-eche ihu mee ka ị daa mba; kama, lee ha anya dị ka ohere maka ịzụlite onwe gị na imeziwanye.

  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

Ọ dị na ngwa Green Bridge

Budata ngwa Green Bridge CBT na ekwentị maọbụ kọmputa gị iji nweta akwụkwọ ndụmọdụ zuru oke, ajụjụ mmụta, na ndị ọzọ.

Akwụkwọ ndụmọdụ zuru oke nwere eserese
Onye inyeaka mmụta AI
Mụọ n'ụzọ na-enweghị ịntaneti, oge ọbụla, ebe ọbụla
Ọ dị na Android, Windows, macOS, na Linux

Ọ dị na ngwa Green Bridge

Budata ngwa Green Bridge CBT na ekwentị maọbụ kọmputa gị iji nweta akwụkwọ ndụmọdụ zuru oke, ajụjụ mmụta, na ndị ọzọ.

Akwụkwọ ndụmọdụ zuru oke nwere eserese
Onye inyeaka mmụta AI
Mụọ n'ụzọ na-enweghị ịntaneti, oge ọbụla, ebe ọbụla
Ọ dị na Android, Windows, macOS, na Linux

Meecha Ajụjụ Ule Ọmarịcha

Ị chọrọ ime ajụjụ ule ọmarịcha gbasara Arrays? Budata ngwa Green Bridge CBT iji nweta ajụjụ ule ọmarịcha na nyocha zuru ezu gbasara isiokwu a.

Dawunlodi Ẹpp naa lori Google Playstore.

Ihe nile ichoro iji nwee ihe ịga nke ọma na JAMB, WAEC & NECO.

Green Bridge CBT Mobile App
Personalized AI Ẹ̀kọ́ Ọ̀rọ̀ Alábàápàdé.
Egbò ọdúnrún JAMB, WAEC & NECO Ajùmọ̀ṣe ìbéèrè ti kọjá.
Ihe karịrị 1200 Nkọwa Nkuzi
Tallafi Ba Tare da Layin Intanet Ba - Koyi Duk Lokaci, Ko'ina
Jadawalin Gada Kore
Akọkọ akọle iwe & Ibeere agbara
Sọfụma Ọrụ Gi & Ọganihu Gi
Ìtọ́jú Ìtúmọ̀ fún Ẹ̀kọ́ Alábáyọrí.