NEW
Font size
S
M
L
XL
WorksheetsProgramming Constructs, Procedures and Functions
Total questions: 36
Worksheet time: 18mins
Name
Class
Date
1.
What is a parameter?
a)
A constant in a program
b)
A variable applied to a procedure or function
c)
A mathematical expression
d)
A data type
2.
When a parameter is passed by value what happens?
a)
The variable can be changed by the procedure
b)
The value of the variable remains unchanged
c)
The variable is deleted
d)
The variable is copied multiple times
3.
What is an argument?
a)
A parameter definition
b)
A mathematical operator
c)
A value passed to a procedure or function from the main program
d)
A constant
4.
What is the purpose of a procedure?
a)
To always return a value
b)
To execute a group of repeated statements
c)
To perform complex mathematical calculations
d)
To define a new data type
5.
In pseudocode how do you indicate the end of a procedure?
a)
Close procedure
b)
End procedure
c)
Stop procedure
d)
Terminate procedure
6.
How are parameters passed in Python?
a)
By reference
b)
By value
c)
By pointer
d)
By memory address
7.
What distinguishes a function from a procedure?
a)
Functions always return a value
b)
Procedures are more complex
c)
Functions are only used in math
d)
Functions cannot have parameters
8.
In the header statement of a function what must be specified?
a)
Loop conditions
b)
Return value
c)
Variable names
d)
Constant values
9.
What happens if arguments are passed in a different order than specified in the header?
a)
The program will automatically rearrange them
b)
The program will crash
c)
The program will ignore the order
d)
The arguments will not be processed
10.
What is a header statement?
a)
A comment at the start of code
b)
The first statement of a procedure containing its name and parameters
c)
A type of variable declaration
d)
A mathematical formula
11.
Which of these is NOT a programming construct mentioned in the transcript?
a)
Variables
b)
Constants
c)
Recursion
d)
Assignment
12.
In pseudocode what does a case statement allow you to do?
a)
Define a single condition
b)
Branch multiple conditions together
c)
Create a loop
d)
Define a constant
13.
What is the Python equivalent of a pseudocode case statement?
a)
Switch statement
b)
Match statement
c)
If statement
d)
Select statement
14.
What does an if-else statement do?
a)
Creates a constant
b)
Performs selection or conditional execution
c)
Defines a function
d)
Creates a loop
15.
What type of loops are mentioned in the transcript?
a)
Only for loops
b)
For and while loops
c)
Repeat-until loops
d)
Switch loops
16.
What is a constant in programming?
a)
A variable that changes
b)
A value that cannot be modified
c)
A temporary storage location
d)
A mathematical operator
17.
How can mathematical expressions be evaluated in programming?
a)
Only through specialized math libraries
b)
Using standard arithmetic operators
c)
By manual calculation
d)
Through graphical interfaces
18.
What logical operators are mentioned?
a)
Plus and minus
b)
Multiply and divide
c)
And or not
d)
Greater than and less than
19.
In a for loop what does 'range(1 10)' typically mean?
a)
Loop from 1 to 9
b)
Loop from 0 to 10
c)
Loop from 2 to 11
d)
Loop from 1 to 10
20.
What does the assignment statement typically do?
a)
Creates a new variable
b)
Deletes a variable
c)
Allocates a value to a variable
d)
Compares two variables
21.
What warning is given about passing different data types to a procedure?
a)
It's always safe
b)
It can lead to a program crash
c)
It improves performance
d)
It creates a new variable
22.
What can happen when a parameter is passed by reference?
a)
The original variable remains unchanged
b)
The value of the parameter can be changed by the procedure
c)
The procedure is deleted
d)
A new variable is created
23.
In a function what must be returned?
a)
Any data type
b)
Only numbers
c)
A value of the same data type as the imported parameters
d)
Multiple values
24.
What is the purpose of practicing problem-solving in coding?
a)
To memorize syntax
b)
To become better at using programming constructs
c)
To create complex algorithms
d)
To optimize code
25.
Which programming construct allows for conditional execution?
a)
For loop
b)
While loop
c)
If-else statement
d)
Assignment statement
26.
What topics are covered in this lesson's practice questions?
a)
Only coding techniques
b)
Definitions differences between procedures and functions and pseudocode completion
c)
Advanced algorithms
d)
Network programming
27.
What does the 'and' symbol typically represent in logical operations?
a)
Addition
b)
Conjunction
c)
Subtraction
d)
Division
28.
What is an identifier in programming?
a)
A special type of constant
b)
A variable name
c)
A mathematical symbol
d)
A loop condition
29.
How should procedure or function arguments be passed?
a)
In any order
b)
Exactly in the order specified in the header
c)
Randomly
d)
Based on variable size
30.
What makes Python different from pseudocode in procedure definition?
a)
No significant difference
b)
Python doesn't require 'end' keywords
c)
Pseudocode is more complex
d)
Python uses different syntax
31.
What is the primary difference between procedures and functions?
a)
There is no difference
b)
Procedures always return values
c)
Functions always return values
d)
Procedures are more complex
32.
What type of calculations can functions perform?
a)
Only mathematical calculations
b)
Repeating statements or calculations
c)
Only string manipulations
d)
Only database operations
33.
What is important when writing a function's return value?
a)
Can change data type freely
b)
Must return the same data type as imported parameters
c)
Can return multiple types
d)
No restrictions apply
34.
What do case statements in pseudocode allow?
a)
Define a single condition
b)
Branch multiple conditions together
c)
Create infinite loops
d)
Generate random numbers
35.
In the depreciation example what concept was being demonstrated?
a)
Simple interest
b)
Compound depreciation
c)
Linear growth
d)
Exponential decay
36.
What is a subroutine?
a)
A type of variable
b)
Another term for a procedure or function
c)
A mathematical operation
d)
A database query
Reset
