Fetch
Decode
Explain
Activities
Flashcards
Exam Questions
Revise
Blog
Contact
Login
Login
Menu
Activities
Flashcards
Exam Questions
Revise
Blog
Contact
Login
Qualifications
OCR GCSE Computer Science
2.2 Programming Fundamentals
Boolean Operators
Card
1
of
18
0
got it
0
still learning
Question
Evil question
Tap
Click or press space
to see the answer
Answer
Still learning
Got it
Turn over
Shuffle
0%
Round complete
Go again with the ones I'm still learning
Start the whole set again
Choose another set
All 18 cards in this set
Which Boolean operator gives True only when both of its conditions are True?
AND
Which Boolean operator gives True when at least one of its conditions is True?
OR
What is meant by 'Boolean'?
A value that is either True or False
What is meant by 'condition'?
An expression that evaluates to True or False
What is meant by a 'compound condition'?
Two or more conditions joined by Boolean operators
What does the not operator do to a condition?
Reverses it, so True becomes False
A program stores a score that can be any whole number from 0 to 100. Which condition is True only for scores in this range?
Score >= 0 and score <= 100
Which condition is True only for scores that are outside the range 0 to 100?
Score < 0 or score > 100
A program must check whether the variable x holds the value 1 or the value 2. Which condition does this correctly?
X == 1 or x == 2
A variable called colour holds the value blue. Which expression evaluates to True?
Not (colour == 'red')
A Boolean variable called found holds the value False. Which condition is True?
Not found
In a condition that uses not, and and or, in which order are the operators worked out?
Not, then and, then or
Which condition is True only for a member who is under 12 or over 65?
(age < 12 or age > 65) and member == 'yes'
A variable x holds the value 5. Which condition gives the result True?
X > 3 and x < 10
A programmer writes score >= 0 and <= 100 to check that a score is in the range 0 to 100, but the program reports an error. Why?
The second comparison does not name score
A program prints Success only when the username is admin and the password is guest. Which condition does this?
Username == 'admin' and password == 'guest'
A variable score holds the value 30. Which condition gives the result True?
Score >= 50 or score < 40
A condition joins two comparisons with or and gives the result False. What must be true?
Both of the comparisons are False