5Medium
0/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?

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

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

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

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

Boolean operations in a programming language Questions

Practise AQA GCSE Computer Science Boolean operations in a programming language with exam-style questions for GCSE Computer Science. 19 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

PreviousNext

Boolean operations in a programming language Questions

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