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

  • 1
    What is the function of a 'variable'?
    Atbilde
    (A)
    To hold a value
  • 2
    In the given pseudo-code, which statement is responsible for displaying output to the user?
    Atbilde
    (D)
    OUTPUT
  • 3
    Which of the following features are commonly found in programming languages to facilitate file handling?
    Atbilde
    A
    B
    D
  • 4
    In Python, how do you open a file to read its content?
    Atbilde
    (B)
    open("filename.txt", "r")
  • 5
    In the program provided, which concept demonstrates an example of abstraction?
    Atbilde
    (A)
    Using MOD and DIV library routines.
  • 6
    Which of these programming elements is most often used to handle decision making in code?
    Atbilde
    (C)
    Conditional statements (IF/ELSE)
  • 7
    What does the `continue` statement do within a loop?
    Atbilde
    (B)
    Skips the rest of the current iteration and goes to the next iteration.
  • 8
    What is the main goal of writing maintainable code?
    Atbilde
    (C)
    To make the code easier to understand, modify, and debug over time.
  • 9
    What will happen if you try to access a local variable outside of its scope?
    Atbilde
    (B)
    The program will generate an error.
  • 10
    What does the keyword `RETURN` typically do in a function?
    Atbilde
    (D)
    It specifies the value that the function will give back.
  • 11
    Which of the following is an example of a valid output statement?
    Atbilde
    (C)
    OUTPUT 'Hello'
  • 12
    What is a benefit of breaking down a complex problem into smaller sub-problems in programming?
    Atbilde
    A
    B
    C
  • 13
    When writing pseudocode, which action should you avoid to improve code readability?
    Atbilde
    (D)
    Using unnecessarily complex or ambiguous logic.
  • 14
    Which of the following is a critical element in the design of efficient and reliable programs?
    Atbilde
    (C)
    Applying the principles of modularity.
  • 15
    What is the name of the programming paradigm that contains procedures?
    Atbilde
    (A)
    Procedural Programming
  • 16
    In the given examples, which type of loop is more similar to the `REPEAT...UNTIL` loop?
    Atbilde
    (C)
    Post-condition (DO...WHILE) loop
  • 17
    In pseudo-code, what does an `IF` statement generally do?
    Atbilde
    (C)
    Make a decision based on a condition
  • 18
    In the example, what is the function of `MOD`?
    Atbilde
    (B)
    To return the remainder after division.
  • 19
    Which of the following is used to represent 'not equal to' in most programming languages?
    Atbilde
    (B)
    !=
  • 20
    What is a key characteristic of a function?
    Atbilde
    (B)
    It always returns a value.
  • 21
    What is the meaning of 'algorithm'?
    Atbilde
    (C)
    A set of steps to solve a problem.
  • 22
    Which operator is used to check if two values are equal?
    Atbilde
    (B)
    ==
  • 23
    Which programming element is essential for creating modular programs?
    Atbilde
    (B)
    Functions or Procedures
  • 24
    Consider an array declaration in pseudocode: `DECLARE myArray : ARRAY[0:9] OF INTEGER`. What does the number 9 represent?
    Atbilde
    (B)
    The last index of the array.
  • 25
    What actions will need to occur to store data persistently?
    Atbilde
    B
    C
    D
  • 26
    What does the acronym API stand for?
    Atbilde
    (B)
    Application Programming Interface
  • 27
    What is 'syntax' in the context of programming?
    Atbilde
    (B)
    The rules for writing the code.
  • 28
    In the context of the provided code snippets, what could `studentAverage` represent?
    Atbilde
    (B)
    The average mark of a single student.
  • 29
    What do parameters within functions or procedures do?
    Atbilde
    (B)
    They pass data into the function or procedure.
  • 30
    In programming, what is a 'constant'?
    Atbilde
    (B)
    A value that cannot be changed during program execution.
  • 31
    In the pseudo-code, how are comments typically used to clarify the program's logic?
    Atbilde
    (B)
    Comments provide explanatory notes within the code.
  • 32
    What is the significance of the data type associated with a variable?
    Atbilde
    (C)
    It determines the type of values the variable can hold and the operations that can be performed on it.
  • 33
    What is the role of an algorithm in programming?
    Atbilde
    (D)
    To provide a step-by-step procedure for solving a problem.
  • 34
    If `Value2 = DIV(17, 3)`, what is the value of `Value2`?
    Atbilde
    (D)
    5
  • 35
    Which data type is best suited for storing whole numbers?
    Atbilde
    (C)
    Integer
  • 36
    What is the purpose of the `try...except` block in Python?
    Atbilde
    (B)
    To handle potential errors and exceptions.
  • 37
    In the given examples, which data type is used to store whole numbers?
    Atbilde
    (C)
    INTEGER
  • 38
    What are the characteristics of a good identifier name in a program?
    Atbilde
    B
    D
  • 39
    What does the term 'parameter' refer to in the context of a function?
    Atbilde
    (B)
    The input values the function uses.
  • 40
    Which variable(s) are likely to be declared as global variables?
    Atbilde
    A
    B
    C
  • 41
    What is the main difference between constants and variables?
    Atbilde
    (C)
    Variables can be changed during program execution, constants cannot.
  • 42
    What is the purpose of an `ELSE` statement when used with an `IF` statement?
    Atbilde
    (A)
    To execute a block of code if the `IF` condition is false.
  • 43
    What is the primary function of a compiler or interpreter?
    Atbilde
    (B)
    To translate the source code into machine-executable code.
  • 44
    In Visual Basic, how do you begin a program?
    Atbilde
    (A)
    With the Module Module
  • 45
    What are library routines?
    Atbilde
    (B)
    Pre-written code modules that perform specific tasks.
  • 46
    In pseudo-code examples, what does the `NumberStudents` constant likely represent in the context of a student mark calculation program?
    Atbilde
    (C)
    The total number of students whose marks are being processed.
  • 47
    What does an algorithm constitute in programming?
    Atbilde
    (B)
    The set of steps to solve a problem.
  • 48
    Which keyword is used in Java to begin the program?
    Atbilde
    (C)
    Main
  • 49
    Which of the following can store multiple data types?
    Atbilde
    (B)
    Structures or Classes
  • 50
    What is the primary purpose of the `IF-THEN-ELSE` construct in programming?
    Atbilde
    (C)
    To control the flow of execution based on a condition.