Search Header Logo

136. OCR A Level (H046-H446) SLR23 – 2.2 Functions & procedures

Authored by James Cole

Computers

11th Grade

136. OCR A Level (H046-H446) SLR23 – 2.2 Functions & procedures
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is modularity in programming?

The practice of writing code in a single, large block

The concept of breaking a large program into smaller chunks

The process of writing code without errors

A method of passing parameters by value

Answer explanation

Modularity in programming refers to the concept of breaking a large program into smaller, manageable chunks, making the code more organized and easier to maintain.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between a function and a procedure?

A procedure returns a value, while a function does not

A function returns a value, while a procedure does not

A function can only take one parameter, while a procedure can take multiple

There is no difference between a function and a procedure

Answer explanation

A function returns a value, while a procedure does not

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does parameter passing by value mean?

A copy of the variable is passed to the subroutine

A pointer to the original variable is passed

The value is passed by reference

The original variable is directly modified

Answer explanation

Parameter passing by value means a copy of the variable is passed to the subroutine, not the original variable itself.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does parameter passing by reference mean?

A pointer to the original variable is passed

The original variable cannot be modified

The value is passed by value

A copy of the variable is passed to the subroutine

Answer explanation

Parameter passing by reference means a pointer to the original variable is passed, allowing modifications to the original variable within the subroutine.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why is it a good idea to develop code in a modular way?

It requires more memory

It prevents the code from being executed

It allows for code to be reused in different parts of a program

It makes the code harder to understand

Answer explanation

Developing code in a modular way allows for code to be reused in different parts of a program, increasing efficiency and reducing redundancy.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of passing a parameter by reference and modifying it?

The original variable is unaffected

The copy of the variable is modified

The original variable is modified

A new variable is created

Answer explanation

The original variable is modified

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a common way to output text to a console in C#?

print()

System.out.println()

echo()

Console.WriteLine()

Answer explanation

The correct way to output text to a console in C# is by using Console.WriteLine().

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?