Subroutines and Functions Activity

Subroutines and Functions Activity

10th Grade

15 Qs

quiz-placeholder

Similar activities

Function evaluation

Function evaluation

10th - 12th Grade

10 Qs

AQA GCSE Computer Science - 3.2.10 Subroutines

AQA GCSE Computer Science - 3.2.10 Subroutines

8th - 10th Grade

20 Qs

GCSE Computing Flash Quiz

GCSE Computing Flash Quiz

10th - 11th Grade

12 Qs

Python Text Files

Python Text Files

10th - 11th Grade

14 Qs

Excel Module 6

Excel Module 6

6th - 12th Grade

17 Qs

Keyboard Shortcuts and other tips

Keyboard Shortcuts and other tips

1st - 12th Grade

10 Qs

High and low level languages

High and low level languages

10th - 12th Grade

17 Qs

[AP CSP] Unit 4 Review: Functions and Lists

[AP CSP] Unit 4 Review: Functions and Lists

9th - 12th Grade

10 Qs

Subroutines and Functions Activity

Subroutines and Functions Activity

Assessment

Quiz

Computers

10th Grade

Hard

Created by

JackR JackR

Used 1+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

What are two types of subroutine used in programming?

Variables and Constants

Functions and Procedures

Loops and Conditions

Arrays and Strings

2.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

How many parameters can functions and procedures have?

Zero, one or many

Three

One

Two

3.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

Explain the difference between a local and global variables

Local variables can be changed once declared, globals cannot be changed once declared

Local variables are declared using the CONSTANT keyword, globals are declared using the VAR keyword

Local variables are accessible anywhere in the program, globals only within the subroutine

Local variables are only accessible within the particular function or procedure, globals are accessible anywhere in the program

4.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

What are three reasons that you should try to use subroutines where possible?

To make the program less maintainable, to decompose the code, to make the program more complex

To reuse code, to make the program less maintainable, to make the program more complex

To make the program more complex, to increase development time, to make program maintenance harder

Reuse code, decomposition, more maintainable code

5.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

What is one other advantage of using subroutines?

Subroutines can be stored in a subroutine library and used in different programs if required

To make the program less maintainable

To make program maintenance harder

To make the program more complex

6.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

What is output by this program? PROCEDURE changeNum num ← 6 OUTPUT num ENDPROCEDURE #Main program num ← 5 OUTPUT num #call function changenum CALL changeNum OUTPUT num

Outputs 5, Outputs 5, Outputs 6

Outputs 5, Outputs 6, Outputs 6

Outputs 5, Outputs 6, Outputs 5

Outputs 6, Outputs 5, Outputs 5

7.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

What type of data structure is heights? How will the function be called?

heights is a tuple, The function is called and the result stored with a statement such as: tallest ← CalcMax(pupilHeights)

heights is an array, The function is called and the result stored with a statement such as: tallest ← CalcMax(pupilHeights)

heights is a list, The function is called and the result stored with a statement such as: tallest ← CalcMax(pupilHeights)

heights is a string, The function is called and the result stored with a statement such as: tallest ← CalcMax(pupilHeights)

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?