Computer Science - 0478 CIE

Arrays

Overzicht

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.

Doelstellingen

  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

Lesnotitie

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.

Beschikbaar in de Green Bridge-app

Download de Green Bridge CBT-app op je telefoon of computer voor toegang tot volledige lesnotities, oefenvragen en meer.

Volledige lesnotities met diagrammen
AI-gestuurde leerassistent
Offline studeren, altijd en overal
Beschikbaar voor Android, Windows, macOS en Linux

Lesevaluatie

Gefeliciteerd met het voltooien van de les op Arrays. Nu je de sleutelconcepten en ideeën, het is tijd om uw kennis op de proef te stellen. Deze sectie biedt een verscheidenheid aan oefeningen vragen die bedoeld zijn om uw begrip te vergroten en u te helpen uw begrip van de stof te peilen.

Je zult een mix van vraagtypen tegenkomen, waaronder meerkeuzevragen, korte antwoordvragen en essayvragen. Elke vraag is zorgvuldig samengesteld om verschillende aspecten van je kennis en kritisch denkvermogen te beoordelen.

Gebruik dit evaluatiegedeelte als een kans om je begrip van het onderwerp te versterken en om gebieden te identificeren waar je mogelijk extra studie nodig hebt. Laat je niet ontmoedigen door eventuele uitdagingen die je tegenkomt; beschouw ze in plaats daarvan als kansen voor groei en verbetering.

  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

Beschikbaar in de Green Bridge-app

Download de Green Bridge CBT-app op je telefoon of computer voor toegang tot volledige lesnotities, oefenvragen en meer.

Volledige lesnotities met diagrammen
AI-gestuurde leerassistent
Offline studeren, altijd en overal
Beschikbaar voor Android, Windows, macOS en Linux

Beschikbaar in de Green Bridge-app

Download de Green Bridge CBT-app op je telefoon of computer voor toegang tot volledige lesnotities, oefenvragen en meer.

Volledige lesnotities met diagrammen
AI-gestuurde leerassistent
Offline studeren, altijd en overal
Beschikbaar voor Android, Windows, macOS en Linux

Oefen Proefexamenvragen

Wilt u proefexamenvragen over Arrays oefenen? Download de Green Bridge CBT-app voor toegang tot proefexamenvragen en volledige oefentoetsen over dit onderwerp.

Download de app in de Google Playstore

Alles wat je nodig hebt om uit te blinken in JAMB, WAEC en NECO.

Green Bridge CBT Mobile App
Persoonlijke AI Leerchat Assistent
Duizenden JAMB-, WAEC- en NECO-examenvragen uit het verleden.
Meer dan 1200 lesnotities
Offline ondersteuning - Leer altijd en overal
Dienstregeling Groene Brug
Literatuursamenvattingen & Potentiële Vragen
Volg je prestaties en vooruitgang.
Diepgaande Uitleg voor Uitgebreid Leren