Computer Science - 9210 OxfordAQA

Subroutines (procedures And Functions)

Overzicht

Open the skeleton program that Paper 1 is built around and you will not find one long list of instructions. You will find a dozen named blocks: one that creates the board, one that places the snakes and ladders, one that displays the board, one that makes a move. Nothing forced the author to write it that way, and every real program is written that way, which is a strong hint that something is being gained.

This lesson covers what a subroutine is, why programs are built out of them, and the two channels through which data travels between a subroutine and the code that called it. Parameters carry data in; return values carry it back out. You will also meet local and global variables, which is where the specimen paper puts two of its marks, and you will learn to say precisely what happens when a subroutine is called rather than waving at it.

Doelstellingen

  1. Understand the concept of subroutines.
  2. Explain the advantages of using subroutines in programs. Use and describe the use of parameters to pass data within programs.
  3. Use subroutines that return values to the calling routine.

Mindmap

Dit onderwerp is in kaart gebracht zodat je ziet hoe de ideeen samenhangen.

Open de mindmap in de app

Lesnotitie

The specification's definition is worth learning word for word, because it is compact and it earns marks: a subroutine is a named out of line block of code that may be executed, or called, by simply writing its name in a program statement.

Volledige lesnotitie beschikbaar in de Green Bridge-app

Installeer de Green Bridge CBT-app op je telefoon of computer voor de volledige IGCSE-bibliotheek: examens uit voorgaande jaren, correctiemodellen, mindmaps, flashcards en audiolessen.

Volledige lesnotities met diagrammen
AI-gestuurde leerassistent
Proefexamens op tijd, nagekeken zodra je klaar bent
Beschikbaar voor Android, Windows, macOS en Linux iOS-app binnenkort beschikbaar

Lesevaluatie

Gefeliciteerd met het voltooien van de les op Subroutines (procedures And Functions). 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. Which statement best describes a subroutine? A. A variable that holds several values B. A named out of line block of code that is executed by writing its name C. A loop that repeats a fixed number of times D. A file that stores program output Answer: B
  2. How many parameters does the subroutine SUBROUTINE Total(A, B, C) have? A. 0 B. 1 C. 3 D. It depends on the call Answer: C
  3. Which statement about a local variable is correct? A. It can be used anywhere in the program B. It uses memory for the whole time the program is running C. It can be used only within the subroutine it is declared in D. It must be a parameter Answer: C
  4. What is the difference between a procedure and a function? A. A function returns a value and a procedure does not B. A procedure can take parameters and a function cannot C. A function is always shorter D. A procedure cannot be called more than once Answer: A
  5. Which is NOT an advantage of using subroutines given in the specification? A. The program runs faster on every machine B. Subroutines can be re-used C. Subroutines can be tested independently D. The structure of the program is clearer Answer: A

Maak deze vragen in de app

Maak deze vragen in de app

Oefen Proefexamenvragen

Wilt u proefexamenvragen over Subroutines (procedures And Functions) 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
Meer dan 200.000 IGCSE-, JAMB-, WAEC- en NECO-examenvragen.
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