Computer Science for IGCSE & O level - Algorithm Design And Problem Solving (Section 2)
1
What is the function of a structure diagram?
Answer(C)
To show the top-down design.
2
Which standard method is used to examine each element in a list?
3
What is the difference between a stack and a queue?
Answer(A)
Stacks use LIFO (Last-In, First-Out) and queues use FIFO (First-In, First-Out).
4
What type of check is used to make sure data input matches a specific format (like a date)?
5
What type of test data is best suited for identifying boundary conditions?
6
What is the main advantage of using pseudocode?
Answer(C)
It is easy to convert to actual code and focuses on the logic.
7
What does the pseudocode statement INPUT represent?
8
Which programming concept involves simplifying complex tasks into manageable steps?
9
In the given pseudocode, what is the purpose of the line 'OUTPUT "Total"'?
Answer(C)
To display the result to the user.
10
Which elements are used in a pseudocode assignment statement?
11
In a pseudocode algorithm, what does the keyword 'THEN' usually follow?
12
What is the purpose of a 'comment' in programming code?
Answer(C)
To provide explanations for the code to other programmers.
13
What is the primary function of the 'ELSE' statement when used with an 'IF' condition?
Answer(B)
To specify the action to take if the 'IF' condition is false.
14
Which of the following data structures uses the principle of LIFO?
15
What are the primary steps involved in an algorithm?
16
What are the characteristics of a good algorithm?
17
What is a common characteristic of a 'stack' data structure?
Answer(B)
Elements are added and removed from the same end (LIFO).
18
What is a 'presence check' used for?
Answer(C)
To make sure data has been entered
19
What is the purpose of the 'Coding' phase in the program development life cycle?
Answer(B)
To write the actual program instructions.
20
What is a benefit of data validation?
21
Which statement is correct regarding the order of elements in a queue?
Answer(B)
Elements are added at one end and removed from the other end.
22
In the concert ticket example, what discount is offered if a customer buys 20 or more tickets?
23
What would be the best data validation check to use for a date of birth field?
24
What is 'top-down design' in the context of program development?
Answer(A)
Breaking down a problem into smaller sub-problems.
25
Which of the following is NOT a key element of the program development life cycle as per the text?
26
When is the most appropriate time to use comments when writing code or pseudocode?
Answer(B)
To clarify the intention and purpose of a block of code, or when the purpose of some code is not obvious.
27
What is the primary purpose of a structure diagram in the context of algorithm design?
Answer(C)
To visualize how the program will be structured as a combination of sub-problems.
28
What type of data structure follows the First-In, First-Out (FIFO) principle?
29
In the context of data validation, what does a 'length check' assess?
Answer(B)
The number of characters entered in an input field.
30
Which statement is best for a scenario that needs different actions depending on the *value* of a variable?
31
If a password needs to be at least 8 characters long, what type of check is appropriate?
32
What are the key components of an alarm app?
33
What is the typical use of a double entry for data input?
Answer(B)
To avoid errors during data input.
34
In a flowchart, what shape is used to represent a process?
35
What does the term 'debugging' refer to in programming?
Answer(B)
The process of finding and fixing errors in the code.
36
What does the CASE statement allow you to do in programming?
Answer(B)
Perform different actions based on the value of a variable.
37
What does 'pseudocode' allow programmers to do?
38
Which of the following checks could be used on a password?
39
Which flowchart symbol is used for input and output?
40
What is the value of the variable 'Amount' after the assignment statement: Amount <- 100?
41
Which of the following is an example of an abnormal test data?
42
Which operator is used for division in pseudocode?
43
Which is the best description of an algorithm?
Answer(B)
A set of rules or steps to follow for solving a specific problem.
44
What is the primary purpose of a check digit in a barcode?
Answer(C)
To detect data entry errors
45
Which of the following are the key components of a computer system as described in the context of problem decomposition?
46
Which of the following is NOT a standard method used when creating algorithms?
Answer(D)
Object Oriented Programming
47
What does a 'presence check' primarily aim to validate?
Answer(B)
That an input field has a value.
48
Which of the following are essential parts of a computer system?
49
What type of diagrams can be used to depict the top-down design?
50
What type of test data would you use to test the behaviour of a program when entering the maximum value for a field?