Theory Questions

Cards (31)

  • What is the fundamental sequence in programming?
    Code runs from top to bottom.
  • What does the term 'selection' refer to in programming?
    Making a decision or choice based on a Boolean expression.
  • What is a Boolean expression?
    An expression that has to be true or false.
  • What is iteration in programming?
    Repeating blocks of code.
  • What are the two types of loops in iteration?
    For loops and while loops.
  • What is a counter-controlled loop?
    A loop that repeats a specific number of times using a counter.
  • How would you write a for loop that repeats code 10 times in Python?
    For i in range(10):
  • What is a while loop?
    A loop that continues as long as a Boolean condition is true.
  • What is a variable in programming?
    A storage location that can be changed.
  • What is a constant in programming?
    A storage location that doesn't change.
  • What is the value of Pi as a constant?
    Pi = 3.14
  • What is a string in programming?
    Alphanumeric text enclosed in speech marks.
  • What is an integer?
    A whole number.
  • What is a float or real number?
    A decimal number.
  • What does a Boolean represent?
    True or False.
  • What is a char in programming?
    A single character.
  • What is a syntax error?
    An error that occurs due to incorrect grammar or layout in code.
  • What is a logic error?
    An error where the code runs but does not produce the expected output.
  • What does 'mod' or 'modular' refer to in programming?
    Division where the remainder is returned.
  • What is the result of 16mod316 \mod 3?

    11
  • What is the symbol for mod in Python?
    %
  • What does 'Div' refer to in programming?
    Division where the whole number is returned.
  • What is the result of 16 Div 316 \text{ Div } 3?

    55
  • What is the symbol for Div in Python?
    //
  • What is a subroutine in programming?
    A module of code that can be reused.
  • What are the benefits of using subroutines?
    They help break down problems and make code easier to maintain.
  • What are the two types of subroutines?
    Functions and procedures.
  • What does a function do?
    Returns a value.
  • What does a procedure do?
    Does not return a value.
  • What is data casting?
    Changing data types.
  • What is concatenation?
    Joining multiple strings together.