Skip to content

Course home

Boolean operations in a programming language

Boolean operations in a programming language

EasyMedium
1
Question 1

Consider the following algorithm designed to control security gate access:

1  is_weekend ← USERINPUT
2  has_pass ← USERINPUT
3  IF NOT (NOT is_weekend AND NOT has_pass) THEN
4      OUTPUT "Access Granted"
5  ELSE
6      OUTPUT "Access Denied"
7  ENDIF

Which of the following is a true statement about this algorithm?

A

The Boolean expression on line 3 is logically equivalent to is_weekend AND has_pass.

B

The output will be "Access Granted" when both is_weekend and has_pass are False.

C

The Boolean expression on line 3 is logically equivalent to is_weekend OR has_pass.

D

The algorithm uses a nested selection construct to evaluate the conditions.

Markscheme

Boolean operations in a programming language Questions

  1. GCSE
  2. /Computer Science
  3. /Boolean operations in a programming language

19 exam-style questions on AQA GCSE Computer Science Boolean operations in a programming language. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank