Search Header Logo

A Level Programming Concepts

Authored by Mr Applewhaite

Computers

12th Grade

Used 2+ times

A Level Programming Concepts
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following pseudocode snippets correctly calculates the total of all even numbers within a range entered by the user?

low = input ("Enter the first number in the range") high = input ("Enter the last number in the range") total = 0 for n = low to high -1 if n MOD 2 == 0 then total = total + n endif next n print("Total of even numbers in the range ",total)

low = input ("Enter the first number in the range") high = input ("Enter the last number in the range") total = 0 for n = low to high if n MOD 2 == 1 then total = total + n endif next n print("Total of even numbers in the range ",total)

low = input ("Enter the first number in the range") high = input ("Enter the last number in the range") total = 0 for n = low to high -1 if n MOD 2 == 1 then total = total + n endif next n print("Total of even numbers in the range ",total)

low = input ("Enter the first number in the range") high = input ("Enter the last number in the range") total = 0 for n = low to high if n MOD 2 == 0 then total = total + n endif next n print("Total of even numbers in the range ",total)

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a way to make programs easy to understand and maintain?

Meaningful variable names

Comments to explain sections of the program

Modular structure

Using complex and obscure variable names

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the subroutine answerYorN if the user inputs "y"?

"Please enter y or n: "

"You must answer y or n"

"y"

"n"

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What does the subroutine answerYorN do if the user inputs an invalid response?

It terminates the program.

It prints "You must answer y or n" and asks for input again.

It returns the invalid response.

It skips the input and continues.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the purpose of the subroutine answerYorN?

To calculate the average temperature.

To validate user input as either "y" or "n".

To find the highest temperature.

To complete the trace table.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the difference between passing parameters by value and by reference.

By value: The value is copied into a variable in the subroutine; By reference: The address is passed to the subroutine.

By value: The address is passed to the subroutine; By reference: The value is copied into a variable in the subroutine.

By value: The value is copied into a variable in the subroutine; By reference: The value is copied into a variable in the subroutine.

By value: The address is passed to the subroutine; By reference: The address is copied into a variable in the subroutine.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is meant by modular programming?

Combining multiple programs into one large program.

Splitting a large program up into self-contained subroutines (modules).

Writing a program without using any subroutines.

Using only global variables in a program.

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?