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

  • 1
    What function is the main goal of a screen/visual check?
    Jawab
    (B)
    User confirmation of entered data.
  • 2
    What data type is commonly validated using a type check?
    Jawab
    (D)
    All of the above.
  • 3
    What is the purpose of the inner loop in a bubble sort algorithm?
    Jawab
    (C)
    To compare adjacent items and swap them if necessary.
  • 4
    In a flowchart, what shape typically represents a decision?
    Jawab
    (B)
    A diamond.
  • 5
    What is the purpose of a presence check?
    Jawab
    (C)
    To ensure a field has an entry.
  • 6
    In the context of a `FOR...TO...NEXT` loop in pseudocode, what is the function of the `NEXT` statement?
    Jawab
    (B)
    To increment the loop counter.
  • 7
    What does the `ELSE` statement do in relation to the `IF` statement?
    Jawab
    (B)
    It specifies an alternative set of actions if the IF condition is false.
  • 8
    What are the steps in using a check digit algorithm?
    Jawab
    (B)
    Multiply, add, and divide.
  • 9
    When designing and constructing a solution to a problem, methods used should be...
    Jawab
    (B)
    Rigorous.
  • 10
    What is the role of a decision symbol in a flowchart?
    Jawab
    (B)
    To decide which action to take next based on a condition.
  • 11
    Which of the following are characteristics of a well-defined algorithm?
    Jawab
    A
    B
    D
  • 12
    What do you typically find in a trace table?
    Jawab
    A
    B
    C
    D
  • 13
    What happens if there are no swaps made in a complete pass of the bubble sort algorithm?
    Jawab
    (A)
    The algorithm stops.
  • 14
    What is the primary objective of developing an algorithm?
    Jawab
    (B)
    To provide step-by-step instructions for solving a problem.
  • 15
    Which validation technique ensures that a mandatory field is filled in?
    Jawab
    (C)
    Presence check
  • 16
    What is the main purpose of a check digit?
    Jawab
    (C)
    To identify errors during data entry
  • 17
    Which types of data validation would be most suitable for checking if an email address is correctly formatted?
    Jawab
    B
    C
    D
  • 18
    In the context of computer science, which of the following is a primary characteristic of a stack data structure?
    Jawab
    (C)
    LIFO (Last-In, First-Out) principle.
  • 19
    Which of the following is a key component of an algorithm that allows it to solve problems effectively?
    Jawab
    A
    B
    D
  • 20
    What is the function of a decision symbol in a flowchart?
    Jawab
    (C)
    To represent a choice or condition.
  • 21
    In a typical `FOR...TO...NEXT` loop, what determines the total number of iterations?
    Jawab
    (B)
    The starting, ending, and step values of the loop counter.
  • 22
    In the bubble sort algorithm, how many times will the outer loop run, if there are 'Length' number of items in the list?
    Jawab
    (B)
    Length - 1 times
  • 23
    In a linear search, when is the search considered complete?
    Jawab
    A
    B
  • 24
    What is a key benefit of using pseudocode when designing algorithms?
    Jawab
    (C)
    It allows for expressing algorithms in a clear and concise manner.
  • 25
    What is the main goal of using test data when refining an algorithm?
    Jawab
    (D)
    To identify errors that may exist and verify all conditions.
  • 26
    What steps are generally needed when the 'counting' algorithm is implemented?
    Jawab
    A
    B
    D
  • 27
    In the `CASE OF` structure, what determines which section of code is executed?
    Jawab
    (A)
    The value of a variable.
  • 28
    If an algorithm needs to execute different actions depending on the value of a variable, which control structure is the most suitable to use?
    Jawab
    (C)
    IF...THEN...ELSE statement
  • 29
    What does a 'trace table' help you do in the context of algorithm development?
    Jawab
    (B)
    To predict the algorithm's output for certain inputs.
  • 30
    Which type of test data is designed to test the maximum and minimum allowable values that a program can accept?
    Jawab
    (D)
    Invalid Data
  • 31
    What are the key steps involved in 'totaling' within an algorithm?
    Jawab
    A
    B
    C
  • 32
    Which of the following is the first stage in the program development life cycle?
    Jawab
    (B)
    Analysis
  • 33
    What are the fundamental stages of the program development life cycle?
    Jawab
    A
    B
    C
  • 34
    What is the role of the variable `Total` in the totaling algorithm?
    Jawab
    (A)
    Store the final total of the marks.
  • 35
    What is the purpose of the 'COUNT' variable in many algorithms (like in the counting example)?
    Jawab
    (B)
    To keep track of the number of items.
  • 36
    In a pseudocode assignment statement, what symbol typically represents the assignment operation?
    Jawab
    (C)
    <-
  • 37
    What is the purpose of the 'CASE OF' structure in an algorithm?
    Jawab
    (B)
    To select one of several options based on the value of an expression.
  • 38
    In the provided algorithm example of validating a password length, what is the result if the password is less than 8 characters?
    Jawab
    (C)
    The algorithm reports an error to the user.
  • 39
    Which of the following is an example of decomposition applied to getting dressed?
    Jawab
    (B)
    Selecting items to wear and then putting them on in order.
  • 40
    What does the process of validation help to ensure?
    Jawab
    (B)
    The input data is reasonable and accurate.
  • 41
    Which category of test data is specifically designed to examine the valid input range's upper and lower bounds?
    Jawab
    (C)
    Extreme data
  • 42
    In the provided bubble sort algorithm, what is the purpose of the nested loop (the inner `FOR` loop)?
    Jawab
    (B)
    To compare and swap adjacent elements.
  • 43
    When is it most important to apply extreme data testing?
    Jawab
    (D)
    Before a program is released to users.
  • 44
    What does an 'infinite loop' in an algorithm cause?
    Jawab
    (C)
    The algorithm to repeat indefinitely.
  • 45
    Which type of test data is designed to test the upper and lower limits of valid input?
    Jawab
    (C)
    Extreme Data
  • 46
    What is a 'presence check' designed to do?
    Jawab
    (A)
    Check if a field has a value entered.
  • 47
    What is the role of 'boundary data' during algorithm testing?
    Jawab
    (A)
    To check how the algorithm processes numbers near the extreme range (boundaries) of acceptable inputs.
  • 48
    Trace tables are mainly used to:
    Jawab
    (C)
    Illustrate the changes in variable values throughout an algorithm's execution.
  • 49
    Which validation technique is used to prevent a missing value in a required field?
    Jawab
    (C)
    Presence check
  • 50
    What is the main difference between a pre-condition and a post-condition loop?
    Jawab
    (B)
    Pre-condition loops check the condition before executing the loop, and post-condition loops check the condition after.