Computer Science for IGCSE & O level - Programming (Section 2)

  • 1
    What is the role of a 'comment' in source code?
    Svare
    (C)
    To provide explanations for humans reading the code.
  • 2
    What is the process of finding and fixing errors in a program called?
    Svare
    (B)
    Debugging
  • 3
    What does an algorithm represent in computer science?
    Svare
    (A)
    A set of instructions for the computer to follow to solve a problem.
  • 4
    Which operator is used for exponentiation (raising a number to a power)?
    Svare
    (B)
    **
  • 5
    Which of the following is a valid example of a data type?
    Svare
    (C)
    String
  • 6
    What is the function of the `len()` method in Python (or equivalent in other languages, like 'length' in some)?
    Svare
    (C)
    To determine the number of characters in a string or elements in a list.
  • 7
    Which of the following is an example of 'iteration'?
    Svare
    (C)
    for loop
  • 8
    Which section is the visual output of the Visual Basic program?
    Svare
    (A)
    The sum window
  • 9
    Which is a common use of comments in code?
    Svare
    (C)
    To provide explanations to the code.
  • 10
    What is the purpose of indentation in programming code?
    Svare
    (B)
    To make the code easier to read and understand.
  • 11
    What is a key feature of a function?
    Svare
    (B)
    It always returns a value.
  • 12
    What is the function of the 'OUTPUT' statement in programming?
    Svare
    (B)
    To display information to the user.
  • 13
    What does `ClassTotal` most likely represent in the example?
    Svare
    (D)
    The total of student scores in the class.
  • 14
    What is the primary goal of using comments in code?
    Svare
    (C)
    To explain the code's functionality.
  • 15
    What is the result of the expression: `(10 > 5) OR (2 < 1)`?
    Svare
    (A)
    True
  • 16
    What is the purpose of a "prompt" when taking input in a program?
    Svare
    (C)
    To show instructions to the user regarding what input is required.
  • 17
    What keyword typically declares a constant variable in programming?
    Svare
    (C)
    CONST
  • 18
    Which data type is most appropriate for representing the radius of a circle?
    Svare
    (D)
    REAL
  • 19
    What data type is suitable for storing textual data, such as a name or a sentence?
    Svare
    (C)
    String
  • 20
    In the provided pseudocode, what does the variable `COUNTER` represent?
    Svare
    (B)
    The number of marks entered.
  • 21
    Which of the following represents the 'input' operation?
    Svare
    (B)
    read()
  • 22
    Which of the following is a common type of error in programming?
    Svare
    (D)
    All of the above
  • 23
    Which programming construct is typically used to process each element of an array sequentially?
    Svare
    (B)
    FOR loop
  • 24
    What is the role of an 'interpreter' in programming?
    Svare
    (B)
    To execute the code directly, line by line.
  • 25
    In a programming context, what is a comment used for?
    Svare
    (C)
    To explain what the code does.
  • 26
    What does the term 'modularity' mean in programming?
    Svare
    (C)
    Dividing a program into independent, reusable components (modules).
  • 27
    What is the result of the expression `10 > 5 AND 2 < 1`?
    Svare
    (B)
    False
  • 28
    Which of the following is a characteristic of a string data type?
    Svare
    (B)
    Stores a sequence of characters.
  • 29
    What is the purpose of an `algorithm`?
    Svare
    (B)
    To solve a problem step-by-step.
  • 30
    Which logical operator returns true if *at least one* condition is true?
    Svare
    (B)
    OR
  • 31
    Which of the following is a valid variable name?
    Svare
    (C)
    _variable
  • 32
    What is the output of: `print "abc" + "def"`?
    Svare
    (C)
    abcdef
  • 33
    Which of the following is a characteristic of a good variable name?
    Svare
    (B)
    Meaningful and descriptive
  • 34
    What is the role of a function?
    Svare
    (B)
    To perform a specific task.
  • 35
    Which of the following is the primary purpose of a library routine?
    Svare
    (A)
    To allow for modularity and reusability of code.
  • 36
    What does the term 'sequence' refer to in the context of programming?
    Svare
    (B)
    The order in which steps in an algorithm are executed.
  • 37
    What does `//` represent in some programming languages (e.g. Python)?
    Svare
    (C)
    Integer division operator
  • 38
    What is the primary role of a compiler?
    Svare
    (B)
    To translate human-readable code into machine code.
  • 39
    Which part of the code is considered a 'function'?
    Svare
    (B)
    A repeatable section of code.
  • 40
    Which data type is appropriate for storing a person's name in a program?
    Svare
    (D)
    STRING
  • 41
    Which best describes the main goal of the provided examples?
    Svare
    (C)
    To teach students how to calculate and display student marks.
  • 42
    What is the benefit of using meaningful identifier names for variables, constants, and procedures?
    Svare
    (C)
    It improves the program's readability and maintainability.
  • 43
    Which of the following are examples of basic concepts used when developing a program?
    Svare
    A
    B
    C
    D
  • 44
    What is the purpose of the 'main' method in a Java program?
    Svare
    (B)
    To start the program's execution.
  • 45
    In programming, what does the `else` clause typically follow?
    Svare
    (B)
    An `IF` statement
  • 46
    Which of these would be considered a variable type?
    Svare
    (A)
    integer
  • 47
    What are the general steps in creating a program?
    Svare
    A
    B
    C
    D
  • 48
    Which of the following tools can you use for debugging your code?
    Svare
    A
    C
    D
  • 49
    Which of the following is an example of a pre-condition loop?
    Svare
    (C)
    WHILE...DO
  • 50
    What is the scope of a local variable?
    Svare
    (B)
    Accessible only within the function or block of code where it is declared.