Edexcel IGCSE Computer Science 4CP0
Algorithms
Searching and Sorting Algorithms
Decomposition and Abstraction
Developing and Testing Code
Programming Constructs and Operators
Data Types and Data Structures
Input, Output and Validation
Data Representation
Data Storage and Compression
Encryption
Hardware and the CPU
Software
Programming Languages and Translators
Networks
Network Security
The Internet and the World Wide Web
Emerging Trends, Issues and Impact
Logic
Logic statements for problems
- 4 things to know
- Papers 1 and 2
Overview
Writing logic statements for real problems, such as alarms, heaters and sprinklers, and using them in program conditions.
What you need to know
Answer each one before you reveal it.
Write the logic expression for this statement: A pump runs if the tank is not full and the power is on
Write a logic statement for a door that unlocks when the correct code is entered or a manager's key card is used
Write a logic statement for a sprinkler that turns on when the soil is dry and it is not raining
Questions from this subtopic
Each one with the model answer underneath.
- 1
A heater turns on if the temperature is low and either a window is closed or the override is on. Write the logic expression.
Model answer
The expression is X = T AND (W OR O), where T is low temperature, W is window closed and O is override on.
- 2
Write the logic expression for this statement: A light comes on if it is dark and either a person is detected or the switch is on.
Model answer
The expression is X = D AND (P OR S), where D is dark, P is person detected and S is switch on.
- 3
Write the logic expression for this statement: A pump runs if the tank is not full and the power is on.
Model answer
The expression is X = NOT F AND P, where F is tank full and P is power on.
- 4
Write the logic expression for this statement: A machine stops if the temperature is high or the pressure is high, unless the override is on.
Model answer
The expression is X = (T OR P) AND NOT O, where T is high temperature, P is high pressure and O is override on.
- 5
Write the logic expression for this statement: A car starts only if the key is present and both the seat belt is fastened and the brake is pressed.
Model answer
The expression is X = K AND (S AND B), where K is key present, S is seat belt fastened and B is brake pressed.
- 6
Write a logic statement for a door that unlocks when the correct code is entered or a manager's key card is used.
Model answer
The statement is Unlock = Code OR Card.
Other ways to work this
The same content, four other ways.
Everything in your subscription
Runs, plus a mode for every other kind of session.
Every question in Logic, on a schedule.
Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.