#8 Procedural programming

#8 Procedural programming

20 Qs

quiz-placeholder

Similar activities

Scientific Variables

Scientific Variables

KG - University

17 Qs

Experimental Design Test

Experimental Design Test

KG - University

20 Qs

Programming 1 Exam 2

Programming 1 Exam 2

KG - University

18 Qs

Unit 2 Vocab

Unit 2 Vocab

8th Grade

17 Qs

Taxes - Unit Test

Taxes - Unit Test

12th Grade

15 Qs

Chapter 4 Test: Strings and Methods

Chapter 4 Test: Strings and Methods

KG - University

20 Qs

#8 Procedural programming

#8 Procedural programming

Assessment

Quiz

others

Medium

Created by

Jan Corboy

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

1. What is the key difference between a procedure and a function?
A. A function always returns an integer value, unlike a procedure, which returns a Boolean
B. A procedure always returns a value but in functions this is optional
C. A function always returns a value whereas a procedure never does
D. Procedures have global scope whereas functions have local scope

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. Which of these rules is true?
A. Functions require parameters but procedures do not
B. It is not essential to provide parameters to all functions or all procedures, but certain functions and procedures will require them
C. Procedures require parameters but functions do not
D. Functions and procedures always require parameters

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

3. What is meant by the 'return type' of a function?
A. Whether the function is indented or not
B. Whether it is a function or a procedure
C. The data type of the value that the function produces when it completes
D. The data type of the parameter taken in by the function

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

4. Which of the following is not compulsory when coding a function?
A. An identifier (a function name)
B. A return type
C. A return statement
D. A parameter

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5. Which of these is a true statement about the scope of a variable?
A. If a variable is declared within a function, it typically has global scope unless otherwise stated
B. If a variable is declared within a function, it typically has local scope unless otherwise stated
C. If a variable is declared within a function, it can be accessed easily from other functions
D. If a variable is declared outside of a function, the various functions of that program cannot typically access it directly

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

6. What is considered good practice when considering scope rules?
A. Make widespread use of global variables to improve the accessibility of all variables
B. Make some global variables and then make some local variables using the same variable names as you used for the global variables as this will aid understanding of your program
C. Try to use approximately 50:50 global and local variables in your program
D. Stick mainly to local variables and pass values around as parameters rather than using global variables in most cases

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

7. What is meant by 'pass by value'?
A. When a variable is passed to a subprogram, any changes made in the subprogram will be reflected in the original variable as well
B. The variable will be passed as a parameter without using the variable name
C. A second copy of the variable's value will be passed into the subprogram and any changes will only affect that second copy and not the original variable itself
D. When a data structure such as an array is passed to a subprogram, the subprogram will only use the first value

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?