Font size
WorksheetsAlgorithm Design, PDLC, and Basics Worksheet
Total questions: 95
Worksheet time: 48mins
What is the first stage of the Program Development Life Cycle (PDLC)?
Coding
Testing
Analysis
Maintenance
During the analysis stage, which technique focuses on ignoring unnecessary details?
Iteration
Decomposition
Abstraction
Validation
Breaking a large problem into smaller sub-problems is called:
Abstraction
Decomposition
Verification
Iteration
Which stage of PDLC uses tools like structure charts, flowcharts and pseudocode?
Analysis
Design
Testing
Maintenance
What is iterative testing?
Testing after the program is released
Testing once at the end
Repeating tests on modules and fixing errors until correct
Testing only with abnormal data
A requirements specification is produced in which stage?
Coding
Analysis
Design
Maintenance
Which document would most likely contain pseudocode and flowcharts?
Maintenance log
Program design document
User manual
Test plan only
Which statement best describes an algorithm?
A single test case
A set of ordered steps to solve a problem
A hardware diagram
A data type
A structure diagram mainly shows:
Variables and data types
Top-down breakdown into sub-systems
Network connections
Test data sets
Which of these occurs in the maintenance stage?
Adding new features after the system is in use
Writing initial pseudocode
Designing test tables
Abstraction and decomposition
Which tool is used to visually show the sequence, selection and iteration in a solution?
Structure diagram
Truth table
Flowchart
Entity-relationship diagram
What is meant by a dry run?
Running code with no input
Manually stepping through an algorithm using test data
Testing only using random data
Running the program without saving
In the notes, a variable is described as:
Data that never changes
Store of data which changes during execution
A label for output only
A hardware register
A constant is:
A variable that is frequently updated
Store of data that remains the same during execution
A loop counter
Only a string type
Which data type is defined as “Single Character e.g. ‘a’, ‘Y’”?
Integer
Real
Char
Boolean
Which pseudocode keyword is used to receive data from the user?
READ
DISPLAY
SHOW
Which pseudocode keyword is used to output data to the user?
READ
INPUT
STORE
How is a variable typically declared in the notes’ pseudocode?
VAR VariableName
DIM VariableName
DECLARE VariableName DATATYPE
CREATE VariableName
A one-dimensional array is declared in pseudocode as:
DECLARE Name ARRAY OF DATATYPE
DECLARE Name ARRAY Lower Limit TO Upper Limit OF DATATYPE
ARRAY Name DATATYPE
MAKEARRAY Name
Which selection structure is described as using IF…THEN…ELSE…ENDIF?
Case structure
Linear search
Conditional statement
Iteration
Which loop always runs at least once?
FOR…TO…NEXT
WHILE…DO…ENDWHILE
REPEAT…UNTIL
CASE…OF…ENDCASE
Which loop may not run at all if the condition is false initially?
REPEAT…UNTIL
FOR…TO…NEXT
WHILE…DO…ENDWHILE
Nested REPEAT
The FOR…TO…NEXT loop is used when:
The number of iterations is unknown
The number of iterations is fixed/known
Only one iteration is needed
The loop must always run once
Which of these correctly shows a comparison using a Boolean expression?
IF Count THEN
IF Total + 1 THEN
IF Score > 50 THEN
IF NAME STRING THEN
Totalling is used in algorithms to:
Count how many times a value appears
Keep a running sum of values
Find the maximum value
Sort values
Counting in an algorithm is mainly used to:
Sum all the values
Find minimum and maximum
Record how many times an event occurs
Reverse an array
In the standard maximum algorithm, the first maximum value is usually set to:
0 always
The last item in the array
The first item in the array
A random value
In the notes, a linear search:
Starts in the middle of the list
Uses binary splitting
Inspects each item in sequence until found or list ends
Needs the list to be sorted
Bubble sort works by:
Inserting each element into its correct place
Selecting the smallest element and swapping
Comparing and swapping adjacent elements repeatedly
Splitting the list into two halves
In bubble sort, after each pass:
All items are sorted
The smallest item is at the start
The largest item in the pass moves to its correct position at the end
The middle item is swapped
Normal data is test data that:
Is outside the allowed range
Lies within the acceptable range of inputs
Is always 0 and 1
Is only text
Abnormal data is:
Within the valid range
Used to check typical values
Data that should be rejected if validation is correct
Only boundary values
Extreme data are:
Values just outside the valid range
The largest and smallest valid values
Always negative
Only string data
Boundary data testing uses:
Only one value at each end of the range
Pairs of values: one just inside and one just outside the limit
Only abnormal data
Only typical data
A trace table is used to:
Store files on disk
Document variable values step-by-step during a dry run
Design flowcharts
Draw network diagrams
In a trace table, each column usually represents:
A single test case only
A variable or output to record changing values
A separate algorithm
A file name
Validation checks are used to:
Ensure data is entered twice
Ensure data is reasonable before it is accepted
Ensure data is copied correctly from one place to another
Ensure passwords are encrypted
A range check ensures:
Data is the right length
Data is of the correct type
A value is between lower and upper limits
A field is not empty
A length check can be used to:
Check if a number is positive
Ensure data has a specific or reasonable number of characters
Check if data is unique
Check if input is numeric
A type check verifies:
That data is within a numeric range
That the data matches the required data type
That two inputs match
That the string is the right length
A presence check is used to:
Ensure the value is not left blank
Ensure the value is numeric
Ensure the value is a date
Ensure the value is unique
A format check is used when:
Checking that data is unique
Data must follow a pattern, e.g. postcode format
Counting records in a file
Sorting a list
A check digit is:
A digit stored at the start of a code
A digit calculated from other digits to verify the code
A random number stored in a file
A type of presence check
Verification is mainly about:
Checking if data is reasonable
Checking if data has been copied correctly from one source to another
Checking if the program runs fast
Checking file sizes
In double-entry verification:
Data is entered twice and compared
Data is entered once and encrypted
Data is stored in two files
Data is checked by a second program
If a date of birth is typed twice and the computer checks the two entries match, this is:
Validation only
Verification by double-entry
Presence check
Length check
Section E: Programming Concepts, Arrays, Procedures & Functions — A global variable is one that:
Can only be used inside one procedure
Is available to all parts of the program
Must be a string
Is read-only
Section E: Programming Concepts, Arrays, Procedures & Functions — A local variable is:
Available everywhere
Only used inside the block where it is declared
Stored permanently in a file
Only used for arrays
Section E: Programming Concepts, Arrays, Procedures & Functions — A one-dimensional array can best be described as:
A single value
A table with rows and columns
A list of elements of the same data type under one name
A set of unrelated variables
Section E: Programming Concepts, Arrays, Procedures & Functions — A two-dimensional array is often described as:
A stack
A queue
A table with rows and columns
A single record
Section E: Programming Concepts, Arrays, Procedures & Functions — Which pseudocode keyword is used to define a procedure?
FUNCTION
PROCEDURE
MODULE
METHOD
Section E: Programming Concepts, Arrays, Procedures & Functions — A function is different from a procedure because it:
Cannot have parameters
Must always read files
Returns a value to the main program
Cannot be reused
Section E: Programming Concepts, Arrays, Procedures & Functions — In pseudocode, what is used in a function to pass a result back?
SEND
EXIT
RETURN
END
Section E: Programming Concepts, Arrays, Procedures & Functions — Library routines are:
Pre-tested procedures/functions provided by the language
Always written by the programmer
Only used for file handling
Only used for graphics
Section E: Programming Concepts, Arrays, Procedures & Functions — Which library routine returns the remainder when one integer is divided by another?
DIV
RANDOM
MOD
ROUND
Section E: Programming Concepts, Arrays, Procedures & Functions — Which routine returns the integer quotient of a division?
DIV
MOD
ROUND
RANDOM
Section E: Programming Concepts, Arrays, Procedures & Functions — Which routine is used to round a real value to a given number of decimal places?
RANDOM
ROUND
MOD
DIV
Section E: Programming Concepts, Arrays, Procedures & Functions — Which routine produces a value between 0 and 1 inclusive?
DIV
MOD
RANDOM
ROUND
Which of the following is a characteristic of a stack data structure?
First In First Out (FIFO)
Dynamic resizing
Random access to elements
Last In First Out (LIFO)
What is the primary purpose of a flowchart?
To write code
To visualize the flow of a program
To debug a program
To store data
Which sorting algorithm has the best average-case time complexity?
Quick Sort
Bubble Sort
Selection Sort
Insertion Sort
In object-oriented programming, what does encapsulation refer to?
Creating multiple instances of a class
Hiding the internal state of an object
Defining a class without methods
Inheriting properties from another class
Which of the following is NOT a valid data type in most programming languages?
Character
String
Pointer
Integer
What is the primary purpose of a loop in programming?
To create a variable
To store data
To repeat a block of code
To define a function
Which of the following is a characteristic of a stack data structure?
First In First Out (FIFO)
Dynamic size
Last In First Out (LIFO)
Random access
In programming, what does 'debugging' refer to?
Testing software
Compiling code
Finding and fixing errors
Writing code
Which of the following is NOT a programming language?
C++
Java
HTML
Python
What does an 'if' statement do in programming?
Defines a function
Checks a condition and executes code based on the result
Declares a variable
Repeats a block of code
Which of the following is a common use of an array?
To manage memory allocation
To create user interfaces
To perform mathematical calculations
To store multiple values in a single variable
What is the output of the following code: print(2 + 3 * 4)?
20
14
17
12
Which of the following best describes a function in programming?
A reusable block of code that performs a specific task
A variable that holds data
A method for sorting data
A type of loop
What is the primary purpose of a function in programming?
To manage memory
To store data
To perform a specific task
To create a user interface
Which of the following is NOT a characteristic of an array?
Dynamic resizing
Indexed access
Homogeneous data types
Fixed size
In programming, what does 'debugging' refer to?
Finding and fixing errors
Optimizing performance
Writing new code
Documenting code
Which data structure uses LIFO (Last In, First Out) principle?
Linked List
Queue
Array
Stack
What is the output of the following code snippet: print(2 + 3 * 4)?
14
17
20
12
Which of the following is a valid way to declare a variable in Python?
int x = 10;
var x = 10;
x = 10
x := 10
What does the term 'recursion' mean in programming?
A method of sorting
A loop that repeats
A function calling itself
A way to manage memory
Which of the following is an example of a conditional statement?
for loop
if statement
while loop
function definition
What is the primary purpose of a loop in programming?
To create a user interface
To define a function
To store data
To execute a block of code multiple times
Which data structure uses key-value pairs?
Array
List
Dictionary
Stack
In which scenario would you use a binary search?
When the data is sorted
When you need to count elements
When the data is unsorted
When you need to find the maximum value
What does the acronym 'API' stand for?
Automated Programming Interface
Application Process Interface
Advanced Programming Integration
Application Programming Interface
Which of the following is a characteristic of a stack data structure?
First In First Out (FIFO)
Last In First Out (LIFO)
Random Access
Dynamic Size
What is the purpose of a function in programming?
To create a loop
To store data
To perform a specific task
To handle errors
Which of the following is NOT a programming paradigm?
Graphical
Object-Oriented
Functional
Procedural
What is the result of the expression 5 + 3 * 2?
8
16
11
10
Which of the following is a common data structure used to store a collection of elements?
Boolean
Array
String
Integer
What is the purpose of a flowchart in programming?
To visualize the logic of a program
To write code
To store data
To compile the program
Which of the following is NOT a type of loop in programming?
Until loop
Do-while loop
While loop
For loop
What does the acronym 'API' stand for?
Automated Programming Interface
Advanced Programming Integration
Application Programming Interface
Application Process Interface
Which sorting algorithm is known for its efficiency in large datasets?
Selection Sort
Insertion Sort
Quick Sort
Bubble Sort
What is the main purpose of a database?
To store and manage data
To perform calculations
To create user interfaces
To compile programs
Which of the following is a characteristic of object-oriented programming?
Sequential processing
Global variables
Encapsulation
Static typing
What is the purpose of a compiler in programming?
To manage memory
To debug programs
To convert source code into machine code
To execute code
