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

  • 1
    What is the purpose of the following algorithm: ```IF PercentageMark < 0 OR PercentageMark > 100 THEN OUTPUT "Fail" ELSE OUTPUT "Pass"```?
    Cevap
    (B)
    To validate the input of percentage marks.
  • 2
    A check digit typically uses which set of operations?
    Cevap
    (C)
    Multiply, add, divide
  • 3
    What does the testing stage ensure in the program development life cycle?
    Cevap
    (B)
    All the tasks work together as specified
  • 4
    What are some of the key steps to implement a linear search algorithm?
    Cevap
    A
    B
    D
  • 5
    In the linear search example, what does the 'Found' flag help to achieve?
    Cevap
    (B)
    Indicate if the target item was located within the list.
  • 6
    In the context of programming and algorithm design, what is the purpose of a loop?
    Cevap
    (B)
    To repeat a set of instructions multiple times.
  • 7
    In the given text, what is the difference between a format check and a type check?
    Cevap
    (B)
    A format check ensures the data is in the correct format, while a type check checks the data type.
  • 8
    What is tested by "normal data"?
    Cevap
    (C)
    The expected functionality of the algorithm.
  • 9
    Which of the following is NOT a step typically included when writing an algorithm?
    Cevap
    (B)
    Creating a user interface.
  • 10
    Which of the following is most commonly associated with checking the content for a particular pattern?
    Cevap
    (B)
    Format check
  • 11
    In an algorithm designed to find the average of a set of marks, which of the following steps is essential?
    Cevap
    (B)
    Calculating the total of the marks.
  • 12
    What does top-down design involve?
    Cevap
    (B)
    Breaking down the problem into a set of smaller sub-systems.
  • 13
    Which is the best way to represent the data in an algorithm?
    Cevap
    (A)
    By using variables.
  • 14
    What type of symbol would you use in a flowchart to represent a decision?
    Cevap
    (B)
    Diamond
  • 15
    What does the analysis stage of the program development life cycle focus on?
    Cevap
    (C)
    Understanding and defining the problem.
  • 16
    What is required to compute the average of a set of values using an algorithm?
    Cevap
    A
    B
  • 17
    In a 'FOR...TO...NEXT' loop, what dictates the number of times the loop body executes?
    Cevap
    (B)
    The loop's start and end values, and the increment value.
  • 18
    What is the purpose of a 'count-controlled' loop?
    Cevap
    (A)
    To repeat a set of instructions a specific number of times.
  • 19
    What is the main goal of the testing phase?
    Cevap
    (B)
    To identify and fix any errors in the code.
  • 20
    What is the objective of a type check?
    Cevap
    (B)
    To verify that the data entered is the appropriate data type (e.g., integer, string).
  • 21
    What does the WHILE...DO...ENDWHILE loop structure do?
    Cevap
    (D)
    It checks the condition at the beginning and continues to execute the loop's actions while the condition is TRUE.
  • 22
    Which of the following is a good practice when creating a trace table?
    Cevap
    A
    B
    C
  • 23
    What does the testing stage of the program development life cycle involve?
    Cevap
    (C)
    Running the program with various test cases.
  • 24
    In the context of validation, what is the primary function of a 'type check'?
    Cevap
    (B)
    To ensure that the data entered is the correct type.
  • 25
    What is one of the advantages of using pseudocode?
    Cevap
    (B)
    It is easy to learn and use.
  • 26
    What is the main purpose of 'data validation' in a software application?
    Cevap
    (B)
    To prevent errors by checking the quality of user-provided data.
  • 27
    Which type of data helps to test the resilience of a program to incorrect input?
    Cevap
    (B)
    Abnormal Data
  • 28
    In what ways can data be invalid?
    Cevap
    A
    B
    C
    D
  • 29
    When should you employ a `WHILE...DO...ENDWHILE` loop?
    Cevap
    (C)
    When the repetition depends on a specific condition.
  • 30
    What are some possible ways to verify that a user's email address has been entered correctly?
    Cevap
    A
    B
    C
  • 31
    In a flowchart, which shape is used to represent a decision (e.g., an IF statement)?
    Cevap
    (C)
    Diamond
  • 32
    What do you represent in a flowchart by using a rectangle?
    Cevap
    (B)
    An action or process.
  • 33
    What should be done after you have tested your algorithm?
    Cevap
    (B)
    Refine and edit it.
  • 34
    What does a trace table help you to see?
    Cevap
    A
    C
    D
  • 35
    What is the purpose of using flow lines in flowcharts?
    Cevap
    (B)
    To show the direction of the steps.
  • 36
    What is the output message when the 'CASE OF' algorithm reaches the default option?
    Cevap
    (D)
    Please enter a valid choice
  • 37
    What is the primary function of a type check?
    Cevap
    (B)
    To verify the data type of an input.
  • 38
    Which of the following is NOT an example of a validation check?
    Cevap
    (D)
    Compilation check.
  • 39
    What is the purpose of an algorithm?
    Cevap
    (A)
    To execute a specific task in a systematic way.
  • 40
    What characteristics determine which data values are compared by the bubble sort algorithm?
    Cevap
    (A)
    Whether they are adjacent to each other.
  • 41
    Why are trace tables useful in debugging an algorithm?
    Cevap
    (B)
    To illustrate how the values of variables change throughout the execution of the algorithm.
  • 42
    Which of the following is an example of a format check?
    Cevap
    (C)
    Checking that a postcode is in the format NNX 9NN.
  • 43
    When implementing a 'Linear Search' algorithm, what aspects characterize the search process?
    Cevap
    A
    D
  • 44
    Which aspects of an algorithm's operation can be shown using a trace table?
    Cevap
    A
    B
    D
  • 45
    In the 'totaling' algorithm, what variable is typically initialized before the loop starts?
    Cevap
    (B)
    A variable to store the final total.
  • 46
    What is the primary purpose of a structure diagram?
    Cevap
    (B)
    To show top-down design in a diagrammatic form.
  • 47
    What is the main purpose of using a trace table?
    Cevap
    (B)
    To trace the flow of an algorithm and observe how the variables change.
  • 48
    In a bubble sort algorithm applied to a list of temperatures, what does `Temperature[Index] > Temperature[Index + 1]` represent?
    Cevap
    (B)
    Comparing the temperature at the current index with the next one.
  • 49
    What type of diagram is used to visually represent an algorithm?
    Cevap
    (B)
    Flowchart
  • 50
    What is the key characteristic of the algorithm represented in the alarm clock example that relates to control flow?
    Cevap
    (D)
    It implements a WHILE loop to check continuously.