Computer Science for IGCSE & O level - Algorithm Design And Problem Solving (Section 4)

  • 1
    Which of the following best describes the purpose of an algorithm?
    Risposta
    (B)
    To provide a step-by-step set of instructions to solve a problem.
  • 2
    What is the purpose of the 'FOR...TO...NEXT' loop structure?
    Risposta
    (B)
    To repeat a block of code a specific number of times.
  • 3
    In pseudocode, which is commonly used to represent assignment?
    Risposta
    (C)
    <-
  • 4
    What is the purpose of a 'range check' in data validation?
    Risposta
    (B)
    To check if the input value is within a pre-defined acceptable range.
  • 5
    What is the role of an 'index' in an array used in a FOR loop?
    Risposta
    (C)
    To indicate the position of an item in the array.
  • 6
    Which of the following is an example of an array?
    Risposta
    (B)
    A data structure used to hold a collection of elements of the same data type.
  • 7
    In a linear search, what action is performed if the search term is not found in the list?
    Risposta
    (C)
    The algorithm outputs 'Not found'.
  • 8
    Which of the following is an example of a linear search?
    Risposta
    (B)
    Checking elements one by one, from the beginning.
  • 9
    What is an advantage of using subroutines?
    Risposta
    A
    B
    D
  • 10
    Which of the following loop types is a 'post-condition' loop?
    Risposta
    (C)
    REPEAT...UNTIL
  • 11
    What shape is typically used in a flowchart to represent a decision or a condition?
    Risposta
    (C)
    Diamond
  • 12
    What is a 'variable' used for in a program?
    Risposta
    (B)
    To store data that can change.
  • 13
    What is the purpose of a queue in data structures?
    Risposta
    (B)
    To store data in a first-in, first-out (FIFO) manner.
  • 14
    Which type of check would be best to prevent a user from entering text in a field that should contain numbers?
    Risposta
    (C)
    Type Check
  • 15
    What type of check would verify a user's password is at least 8 characters long?
    Risposta
    (C)
    Length check
  • 16
    What are the basic parts of a system?
    Risposta
    A
    B
    C
  • 17
    Which of the following loop structures is most appropriate for reading values into an array with a known length?
    Risposta
    (C)
    FOR ... TO ... NEXT
  • 18
    Which of the following structures would be best suited for adding items to a list and removing the oldest item on the list?
    Risposta
    (B)
    Queue
  • 19
    Which of the following is NOT a characteristic of a good algorithm?
    Risposta
    (B)
    Ambiguity
  • 20
    What is the purpose of data validation?
    Risposta
    (B)
    To ensure data quality and accuracy.
  • 21
    What is the primary goal of modularity in software design?
    Risposta
    (B)
    To break down the code into smaller, manageable, and reusable units.
  • 22
    Which of the following is NOT a valid data validation check?
    Risposta
    (C)
    Arithmetic check
  • 23
    What is a 'subroutine' or 'procedure' in programming?
    Risposta
    (B)
    A small, self-contained block of code that performs a specific task.
  • 24
    In an algorithm, what does a 'variable' represent?
    Risposta
    (B)
    A named storage location for data.
  • 25
    Which method can prevent the incorrect values in a double entry data?
    Risposta
    (D)
    The system compares the data entered by different operators
  • 26
    What is the purpose of the 'flag' variable in a linear search?
    Risposta
    (B)
    To indicate whether the search should continue or stop.
  • 27
    What is the first stage in the program development life cycle?
    Risposta
    (C)
    Analysis
  • 28
    What happens if the value entered does not pass the data validation check?
    Risposta
    (C)
    An error message is displayed, and the user is prompted to re-enter the data.
  • 29
    Which of the following is NOT a standard control structure?
    Risposta
    (D)
    Abstraction
  • 30
    What does the diamond-shaped symbol represent in a flowchart?
    Risposta
    (B)
    Decision
  • 31
    What does the 'ELSE' keyword indicate within the IF-THEN-ELSE-ENDIF structure?
    Risposta
    (C)
    The action to be taken if the condition is false
  • 32
    In the context of algorithm design, what does verification mainly concern?
    Risposta
    (B)
    Confirming data accuracy from one place to another.
  • 33
    Which type of loop is best suited for repeating a process until a specific condition is met?
    Risposta
    (D)
    REPEAT...UNTIL
  • 34
    If you wanted to validate an email address input field, which checks would be most appropriate?
    Risposta
    B
    D
  • 35
    What are the advantages of using a modular approach in algorithm design?
    Risposta
    A
    B
    C
  • 36
    In a structure diagram, what is depicted?
    Risposta
    (D)
    The hierarchical organization of the system.
  • 37
    What does the decision flowchart symbol represent?
    Risposta
    (C)
    A condition
  • 38
    Which of the following checks can be applied to data?
    Risposta
    A
    B
    C
  • 39
    What is the main advantage of using functions or subroutines in a program?
    Risposta
    (C)
    They improve code readability and reduce redundancy.
  • 40
    In the context of a WHILE loop, what determines when the loop will terminate?
    Risposta
    (B)
    When the condition in the loop becomes false.
  • 41
    What is the purpose of decomposition in problem-solving?
    Risposta
    (B)
    To simplify the problem by breaking it down into smaller, manageable parts.
  • 42
    What does the term 'pseudocode' refer to?
    Risposta
    (C)
    A simplified way of writing algorithms using plain language and structure.
  • 43
    What is the purpose of a flowchart in algorithm design?
    Risposta
    (B)
    To visually represent the steps of an algorithm.
  • 44
    In the context of algorithm design, what is meant by 'efficiency'?
    Risposta
    (C)
    The algorithm uses minimal resources (time, memory).
  • 45
    What is the main advantage of using a trace table in an algorithm?
    Risposta
    (C)
    It helps to identify errors by tracking variable values.
  • 46
    Which of the following statements is true about the IF-THEN-ELSE-ENDIF structure?
    Risposta
    (B)
    It is used to make decisions.
  • 47
    What is the benefit of breaking down a complex problem into smaller parts in the context of programming?
    Risposta
    (B)
    It makes the problem easier to solve and understand.
  • 48
    What is the role of an 'index' in an array?
    Risposta
    (C)
    To identify and access specific elements within the array.
  • 49
    What is an abstraction in computer science?
    Risposta
    (A)
    The process of hiding implementation details and exposing only essential information.
  • 50
    What is a 'pre-condition' loop?
    Risposta
    (A)
    A loop where the condition is checked before each iteration.