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?
Answer(B)
User confirmation of entered data.
2
What data type is commonly validated using a type check?
3
What is the purpose of the inner loop in a bubble sort algorithm?
Answer(C)
To compare adjacent items and swap them if necessary.
4
In a flowchart, what shape typically represents a decision?
5
What is the purpose of a presence check?
Answer(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?
Answer(B)
To increment the loop counter.
7
What does the `ELSE` statement do in relation to the `IF` statement?
Answer(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?
Answer(B)
Multiply, add, and divide.
9
When designing and constructing a solution to a problem, methods used should be...
10
What is the role of a decision symbol in a flowchart?
Answer(B)
To decide which action to take next based on a condition.
11
Which of the following are characteristics of a well-defined algorithm?
12
What do you typically find in a trace table?
13
What happens if there are no swaps made in a complete pass of the bubble sort algorithm?
14
What is the primary objective of developing an algorithm?
Answer(B)
To provide step-by-step instructions for solving a problem.
15
Which validation technique ensures that a mandatory field is filled in?
16
What is the main purpose of a check digit?
Answer(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?
18
In the context of computer science, which of the following is a primary characteristic of a stack data structure?
Answer(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?
20
What is the function of a decision symbol in a flowchart?
Answer(C)
To represent a choice or condition.
21
In a typical `FOR...TO...NEXT` loop, what determines the total number of iterations?
Answer(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?
23
In a linear search, when is the search considered complete?
24
What is a key benefit of using pseudocode when designing algorithms?
Answer(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?
Answer(D)
To identify errors that may exist and verify all conditions.
26
What steps are generally needed when the 'counting' algorithm is implemented?
27
In the `CASE OF` structure, what determines which section of code is executed?
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?
Answer(C)
IF...THEN...ELSE statement
29
What does a 'trace table' help you do in the context of algorithm development?
Answer(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?
31
What are the key steps involved in 'totaling' within an algorithm?
32
Which of the following is the first stage in the program development life cycle?
33
What are the fundamental stages of the program development life cycle?
34
What is the role of the variable `Total` in the totaling algorithm?
Answer(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)?
Answer(B)
To keep track of the number of items.
36
In a pseudocode assignment statement, what symbol typically represents the assignment operation?
37
What is the purpose of the 'CASE OF' structure in an algorithm?
Answer(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?
Answer(C)
The algorithm reports an error to the user.
39
Which of the following is an example of decomposition applied to getting dressed?
Answer(B)
Selecting items to wear and then putting them on in order.
40
What does the process of validation help to ensure?
Answer(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?
42
In the provided bubble sort algorithm, what is the purpose of the nested loop (the inner `FOR` loop)?
Answer(B)
To compare and swap adjacent elements.
43
When is it most important to apply extreme data testing?
Answer(D)
Before a program is released to users.
44
What does an 'infinite loop' in an algorithm cause?
Answer(C)
The algorithm to repeat indefinitely.
45
Which type of test data is designed to test the upper and lower limits of valid input?
46
What is a 'presence check' designed to do?
Answer(A)
Check if a field has a value entered.
47
What is the role of 'boundary data' during algorithm testing?
Answer(A)
To check how the algorithm processes numbers near the extreme range (boundaries) of acceptable inputs.
48
Trace tables are mainly used to:
Answer(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?
50
What is the main difference between a pre-condition and a post-condition loop?
Answer(B)
Pre-condition loops check the condition before executing the loop, and post-condition loops check the condition after.