Lesson 2.2.1

2.2.1 Programming fundamentals Quiz: OCR Computer Science, Unit 8

20 questions

In partnership with Revision Ninja

Lesson 2.2.1, Programming fundamentals: 20 multiple choice questions for the OCR GCSE Computer Science (J277), Unit 8: Programming fundamentals, written with Revision Ninja.

Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.

Host this setFree Play

The 20 questions

  1. Which programming construct is used to execute a block of code repeatedly until a condition is met?

    • Iteration
    • Sequence
    • Assignment
    • Selection
  2. What term describes data that can change while the program is running?

    • Constant
    • String
    • Integer
    • Variable
  3. What is 17 MOD 5?

    • 2
    • 3.4
    • 85
    • 3
  4. What is 2 ^ 3?

    • 5
    • 9
    • 6
    • 8
  5. Which operator means 'not equal to'?

    • !=
    • <=
    • ==
    • >=
  6. What describes a count-controlled loop?

    • Condition-based loop
    • Random termination
    • Infinite repetition
    • Fixed repetition count
  7. Which programming construct allows code to branch based on a condition?

    • Assignment
    • Selection
    • Iteration
    • Sequence
  8. Which Boolean operator gives TRUE only when both inputs are TRUE?

    • AND
    • OR
    • NAND
    • NOT
  9. What is the final value of x after x = 3, then x = x + 4, then x = x * 2?

    • 14
    • 24
    • 7
    • 10
  10. In a Boolean AND operation with one false condition, what is the output?

    • Null
    • True
    • Error
    • False
  11. How many times does FOR i = 1 TO 5 run its body?

    • 4
    • 6
    • 5
    • 1
  12. A loop repeats WHILE total < 20. Total starts at 0 and increases by 6 each pass. How many passes run?

    • 4
    • 3
    • 5
    • 20
  13. If a condition has the Boolean value FALSE, what does NOT give?

    • FALSE
    • NULL
    • TRUE
    • Undefined
  14. What is 29 DIV 4?

    • 7
    • 4
    • 8
    • 1
  15. In the assignment statement score <- score + 10, what occurs?

    • Score resets to 0
    • Score multiplies by 10
    • Score decreases by 10
    • Score increases by 10
  16. Which statement is an output?

    • PRINT name
    • name <- 'Sam'
    • INPUT name
    • IF name = 'Sam'
  17. A loop counts i from 1 to 10 and adds 1 to a count each time i MOD 2 = 0. What is count at the end?

    • 10
    • 5
    • 4
    • 2
  18. What are the three core programming constructs combined?

    • Variable constant data
    • Input process output
    • Array record file
    • Sequence selection iteration
  19. Given x = 5 and y = 3, which expression evaluates to TRUE?

    • x > 4 OR y < 2
    • x > 4 AND y < 2
    • x < 4 AND y > 5
    • NOT (x > 4)
  20. A loop should count down from 10 to 1. Which loop header is most suitable?

    • FOR i = 0 TO 10 STEP 1
    • FOR i = 10 TO 1 STEP -1
    • WHILE i > 10
    • FOR i = 1 TO 10

All OCR Computer Science quizzes