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

  • 1
    What are parameters used for in functions or procedures?
    Відповідь
    (B)
    To pass data into the function or procedure.
  • 2
    What is the main goal of program testing?
    Відповідь
    (C)
    To ensure the program functions correctly and meets requirements.
  • 3
    What is a 'procedure' or 'function' used for in programming?
    Відповідь
    (C)
    To group a set of instructions to perform a specific task.
  • 4
    In the provided image what is the index of the staff in position 1 in the array `StaffName[]`?
    Відповідь
    (A)
    0
  • 5
    What is a 'constant' in programming?
    Відповідь
    (B)
    A value that cannot be changed during program execution.
  • 6
    What is the role of the library routines?
    Відповідь
    (B)
    They are sets of pre-written functions that perform specific tasks.
  • 7
    What type of operator is `>`?
    Відповідь
    (C)
    Comparison Operator
  • 8
    What is a "pseudocode"?
    Відповідь
    (C)
    An informal way to describe a program.
  • 9
    What does the term 'variable' refer to in programming?
    Відповідь
    (B)
    A named storage location for data.
  • 10
    What is the purpose of the `NumberStudents` constant in the given pseudo-code?
    Відповідь
    (C)
    To define the number of students whose data is being processed.
  • 11
    What is the scope of a local variable?
    Відповідь
    (B)
    Accessible within the function or block where it is defined.
  • 12
    What is the benefit of using meaningful identifier names (variables, functions, etc.) in your code?
    Відповідь
    (C)
    It makes the code easier to understand and maintain.
  • 13
    What is a key characteristic of a local variable?
    Відповідь
    (C)
    It is limited to the part of the program where it is declared.
  • 14
    What is the primary difference between a pre-condition loop and a post-condition loop?
    Відповідь
    (C)
    Pre-condition loops check the condition before the loop body is executed.
  • 15
    Which of the following is an example of an output statement in Python?
    Відповідь
    (B)
    print()
  • 16
    What is the purpose of the `ELSE IF` statement?
    Відповідь
    (B)
    To test another condition if the initial `IF` condition is false.
  • 17
    What does a two-dimensional array conceptually represent?
    Відповідь
    (B)
    A table with rows and columns
  • 18
    Which of the following is not a logical operator?
    Відповідь
    (D)
    XOR
  • 19
    What are library routines primarily used for?
    Відповідь
    (C)
    To perform common tasks and operations.
  • 20
    What is the purpose of an `AND` operator in a conditional statement?
    Відповідь
    (B)
    To combine two conditions, both of which must be true.
  • 21
    What is the purpose of a `return` statement within a function?
    Відповідь
    (B)
    To exit the function and optionally send a value back.
  • 22
    What is the purpose of a `break` statement within a loop in most programming languages?
    Відповідь
    (B)
    To exit the loop prematurely.
  • 23
    What is the output of the Python code: `print(type(3.14))`?
    Відповідь
    (C)
  • 24
    What is the primary use of the `ROUND` routine in the given pseudo-code context?
    Відповідь
    (C)
    To round a number to a specified number of decimal places.
  • 25
    In the context of programming, what is a variable?
    Відповідь
    (B)
    A named storage location for data.
  • 26
    In pseudocode, how do you begin an 'IF' statement?
    Відповідь
    (B)
    IF
  • 27
    What is the benefit of modular programming?
    Відповідь
    (D)
    It makes the code more manageable and easier to maintain.
  • 28
    Which data type would best represent the weight of a person?
    Відповідь
    (B)
    REAL
  • 29
    What type of data is represented by the variable `TotalWeight` in the given example?
    Відповідь
    (C)
    Integer
  • 30
    In programming, what does the term 'iteration' refer to?
    Відповідь
    (A)
    Repeating a block of code.
  • 31
    What is the key function of a "compiler"?
    Відповідь
    (B)
    To translate high-level code to machine code.
  • 32
    Which of the following would be a suitable data type for storing a student's grade (e.g., A, B, C)?
    Відповідь
    (B)
    String
  • 33
    Which of the following is a fundamental programming concept related to making choices?
    Відповідь
    (C)
    Selection
  • 34
    What is the function of the `MOD` library routine?
    Відповідь
    (A)
    Returns the remainder of a division.
  • 35
    What is the primary function of comments in code?
    Відповідь
    (B)
    To provide explanations to the programmer and others reading the code.
  • 36
    What is a Boolean data type primarily used for?
    Відповідь
    (C)
    Representing true or false values
  • 37
    What is the purpose of an IDE in programming?
    Відповідь
    (B)
    To write and run code.
  • 38
    Which of the following statements correctly illustrates the use of a nested IF statement?
    Відповідь
    (B)
    IF condition1 THEN IF condition2 THEN statement1 ENDIF ENDIF
  • 39
    What is the purpose of the 'ELSE' part in an 'IF-ELSE' statement?
    Відповідь
    (B)
    To specify the code to execute if the condition is false.
  • 40
    What is the purpose of the `Total = Total + Mark` statement in the code?
    Відповідь
    (C)
    To add the current mark to the running total.
  • 41
    What is the primary benefit of modular programming?
    Відповідь
    (B)
    It helps in code reuse and makes the code easier to understand and maintain.
  • 42
    What is the main function of the `RETURN` keyword within a function?
    Відповідь
    (C)
    To send data back to the caller of the function.
  • 43
    What is the key difference between `totaling` and `counting`?
    Відповідь
    (B)
    Totaling sums numerical values while counting determines the frequency of occurrences.
  • 44
    What are comments mainly used for in code?
    Відповідь
    (B)
    To provide explanations and document the code.
  • 45
    What is the purpose of the `DECLARE` statement in the pseudo-code examples?
    Відповідь
    (C)
    To declare variables and their data types.
  • 46
    Which string handling method is used to find the number of characters in a string?
    Відповідь
    (B)
    Length
  • 47
    What is a 'loop' commonly used for in a program?
    Відповідь
    (B)
    To repeat a set of instructions.
  • 48
    What is the purpose of parameters in functions and procedures?
    Відповідь
    (B)
    They pass data into the function or procedure.
  • 49
    What is the purpose of the `//` symbol in the provided code snippets (as used in some programming languages)?
    Відповідь
    (B)
    To start a comment.
  • 50
    What is the primary function of the `IF` statement in programming?
    Відповідь
    (C)
    To execute a block of code if a condition is true.