Search Header Logo

CS Unit 5: Functions and Subroutines

Authored by Ahmed Abdallah

Computers

12th Grade

Used 1+ times

CS Unit 5: Functions and Subroutines
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

14 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an advantage of using subroutines?

Faster execution time

Limited code organization

Easier to reuse code

Easier to spot errors

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between a function and a procedure?

Functions are faster than procedures

Procedures return values, functions do not

Functions return values, procedures do not

Procedures are used for input only

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does a function do in a program?

Handle user input errors

Execute a specific set of commands

Print statements to the console

Calculate or process a value

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens when the return line is executed in a function?

Function terminates and returns a value

Function continues executing code

Function prints a message to the console

Function restarts from the beginning

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main benefit of using functions in programming?

Code obfuscation

Code duplication

Code complexity

Code reusability

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of an argument in a function?

Values returned by the function

Values passed into the function

Values printed to the console

Values stored in memory

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the significance of using trace tables in functions?

Investigate function behavior

Handle user input errors

Terminate the program

Print messages to the console

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?