levo

Logic

Logic statements for problems

  • 4 things to know
  • Papers 1 and 2
Start revising · £5/month

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.

Your recallNot started
Key term

How are logic statements used in programs?

Key term

Write the logic expression for this statement: A pump runs if the tank is not full and the power is on

Key term

Write a logic statement for a door that unlocks when the correct code is entered or a manager's key card is used

Key term

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. 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. 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. 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. 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. 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. 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.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

Algorithms
Searching and Sorting Algorithms
Decomposition and Abstraction
Developing and Testing Code

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

Denary is a base system.
1028

Blank Blitz consolidates the facts

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

Nibble means a group of four bits.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

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.