2210/22 · May/June 2026
Download PDFIdentify the type of validation check used in each description. A check to make sure that data has been input and not left blank.
A value placed at the end of a sequence of numbers in the code. The value is calculated from all the other values before it.
Explain the purpose of a format check and give an example of where it could be used. purpose ..................................................................................................................................... example ....................................................................................................................................
Write the pseudocode for an algorithm to perform a validation check on each number as it is input, using the following criteria: • Input one number at a time. • If the number is a whole number, store it in the current element of array Accepted[] • If the number is not a whole number, ask for it to be input again until it is a whole number. • When 15 whole numbers have been stored, output a message that states the check has been completed. Use appropriate input prompts and output messages to make the requirements clear to the user. You do not need to declare any arrays or variables for this algorithm.
The program development life cycle is split into several stages. Outline what happens during the coding and testing stages of the program development life cycle. coding ............................................................................................................................................... testing ...............................................................................................................................................
The purpose of this pseudocode algorithm is to find the name of a customer using an account ID, which contains letters and numbers. The name of the customer and the account ID are stored in the prepopulated two-dimensional (2D) array Accounts[]. The algorithm would then output the name of the customer. For example, Accounts[1, 1] contains the account ID of the first customer and Accounts[1, 2] contains the name of the first customer. 01 DECLARE Accounts : ARRAY[1:1000, 1:2] OF STRING 02 DECLARE Row : INTEGER 03 DECLARE AccountID : INTEGER 04 OUTPUT "Please enter an account ID " 05 OUTPUT AccountID 06 FOR Row 1 TO 1000 07 CASE OF AccountID = Accounts[Row, 1] 08 THEN 09 OUTPUT "The customer’s name is ", Accounts[1, 2] 10 ENDIF 11 NEXT Row

Identify the line numbers of four errors in the pseudocode and suggest corrections. error 1 line number .............................. correction .................................................................................................................................. error 2 line number .............................. correction .................................................................................................................................. error 3 line number .............................. correction .................................................................................................................................. error 4 line number .............................. correction ..................................................................................................................................
State the name given to this type of algorithm.
The algorithm stops if the account number is not found in the array. Write the pseudocode statements to change the algorithm to inform the user that the account number has not been found in the array. Clearly state where in the original algorithm your new statements would be placed. Do not rewrite the whole algorithm.
This flowchart represents an algorithm.
Complete the trace table for the algorithm, using the input data: post, Y, committee, N, bookkeeper Note: the first character of each word is in position 1.
State the purpose of the algorithm shown by the flowchart.
State one reason to store data in a file.
A list of names of the members of a club are stored in a file called Names.txt Write the pseudocode statements to load a line of text from Names.txt and assign the line of text to an appropriately named variable.
Consider the logic expression: Z = NOT (B OR NOT C) XOR (A NAND C)
Draw a logic circuit for this logic expression. Each logic gate must have a maximum of two inputs. Do not simplify the logic expression.
Complete the truth table from the given logic expression.
A database table CAR_PARTS stores details of car parts that a business has in stock. Complete the table by giving the most appropriate data types for each field. Only the data types: text, character, Boolean, integer, real and date/time are available in this database.
Complete the structured query language (SQL) statement to list only the part ID, type of car and the quantity in stock of all the car parts that are brake pads. SELECT ..................................................................................................................................... FROM ......................................................................................................................................... WHERE ..................................................................................................................................... ;
Describe one reason why the InStock field is not needed in the table.
A program is required to record and analyse the daily rainfall in millimetres for one year. Assume a year has 365 days. The one-dimensional (1D) array Rainfall[] is used to store the daily rainfall measurements. Write a program for the following requirements: • Initialise the array Rainfall[] to zero. • Input the rainfall measurement in millimetres for each day and store it in the array. • Calculate the following statistics after all the inputs have been made for the year: ◦ the total rainfall for the year in centimetres (1 centimetre = 10 millimetres), rounded to two decimal places ◦ the mean average daily rainfall in millimetres, rounded to four decimal places ◦ the total number of days with no rainfall ◦ the longest number of consecutive days in which there was no rainfall. • Output all the calculated statistics with clear and appropriate messaging. • If the longest number of consecutive days in which there was no rainfall is 15 or more, output a message to indicate there was a drought (a long period when there is little or no rainfall). You must use pseudocode or program code and add comments to explain how your code works. All arrays, variables or constants used must be declared for this algorithm. All inputs and outputs must contain suitable messages.






