Search Header Logo
H SDD - Parameter passing  (revision)

H SDD - Parameter passing (revision)

Assessment

Presentation

Computers

10th Grade

Practice Problem

Easy

Created by

G Alexander-Doyle

Used 7+ times

FREE Resource

8 Slides • 5 Questions

1

Parameter passing

Higher Computing Science - Software Design & Development

2

  • I can identify formal parameters and their associated actual parameters in code  

Achievements

  • We are learning how data can be passed in and out of sub-programs using parameter passing.  

aims

3

Parameter passing

A parameter is a value  that is being passed into and/or out of a subprogram. When this subprogram is called the program must provided the required parameters, this is called parameter passing.

4

Actual Parameters

An actual parameter is the value that is being passed into the subprogram that will be used in within the scope of that subprogram. These parameters are used in call statements and can be the raw data or assigned to a variable. The call statements will always include the name of the sub-program with the parameters in brackets like so :-

Validate_percentage (0, 100, number)
SET Score TO Calculate_percentage (exam_score, coursework_score)

5

Actual Parameters - Exam question

The code below was created to display the dogID for those customers that are to be offered a discount.

media

Identify the line of code that would contain the actual parameters.

6

Formal Parameters

A formal parameter is the name given to the parameters identified in definition of the subprogram. Formal parameters are the parameters within brackets in the declaration of a function or procedure. The declaration will always include either PROCEDURE or FUNCTION, the name of the sub-program and the formal parameters in brackets like so :-

FUNCTION Calculate_score (INTEGER exam_score, INTEGER coursework_score)

7

FORMAL Parameters - Exam question

The code below was created to display the dogID for those customers that are to be offered a discount.

media

Identify the line of code that would contain the formal parameters.

8

Open Ended

Question image

Formal and actual parameters are used in this code.

Identify one formal parameter and its associated actual parameter. (2 marks)

9

Open Ended

Question image

Formal and actual parameters are used in this code above.

Identify one formal parameter and its associated actual parameter. (2 marks)

10

Fill in the Blank

Question image

Identify a formal parameter from the code shown above. (1 mark)

11

Fill in the Blank

Question image

Identify an actual parameter from the code shown above. (1 mark)

12

Open Ended

Question image

Describe how the parameters are used when executing line 23. Your answer should identify the formal and actual parameters. (3 marks)

13

media

Parameter passing

Higher Computing Science - Software Design & Development

Show answer

Auto Play

Slide 1 / 13

SLIDE