Computer Science - 9210 OxfordAQA

Subroutines (procedures And Functions)

Akopọ

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.

Awọn Afojusun

  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.

Àwòrán ọpọlọ

A ti ṣe àwòrán kókó yìí kí o lè rí bí àwọn èrò ṣe so pọ̀.

Ṣí àwòrán ọpọlọ nínú áàpù

Akọ̀wé Ẹ̀kọ́

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.

Àkọsílẹ̀ Ẹ̀kọ́ Pípé wà lórí Ohun Èlò Green Bridge

Gba ohun èlò Green Bridge CBT sórí fóònù tàbí kọ̀mpútà rẹ fún gbogbo ilé ìkàwé IGCSE: ìwé ìdánwò àtijọ́, ìlànà ìdíwọ̀n, àwòrán èrò, káàdì ìkẹ́kọ̀ọ́ àti ẹ̀kọ́ ohùn.

Awọn akọsilẹ ẹkọ ni kikun pẹlu awọn aworan apejuwe
Oluranlọwọ ẹkọ ti AI ṣe agbara rẹ
Ìdánwò àdáṣe onítọ̀kọ̀ tí a ń ṣàyẹ̀wò lẹ́sẹ̀kẹsẹ̀ tí o bá parí
O wa lori Android, Windows, macOS, ati Linux Áàpù iOS ń bọ̀ láìpẹ́

Ìdánwò Ẹ̀kọ́

Oriire fun ipari ẹkọ lori Subroutines (procedures And Functions). 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. 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

Ṣiṣẹ́ lórí àwọn ìbéèrè wọ̀nyí nínú ohun èlò náà

Ṣiṣẹ́ lórí àwọn ìbéèrè wọ̀nyí nínú ohun èlò náà

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

Ṣe o fẹ ṣe adaṣe awọn ibeere idanwo adaṣe nipa Subroutines (procedures And Functions)? Ṣ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
Ìbéèrè ìdánwò IGCSE, JAMB, WAEC ati NECO tó ju 200,000 lọ
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ẹ̀.