Which of the following pseudocode DECLARE statements correctly defines a variable to store a single symbol such as '%' or '?' according to the syllabus standards?
Cambridge IGCSE · Computer Science (0478)
Programming concepts: Practice Questions
5 multiple-choice questions marked as you go, and 5 written questions with worked solutions. All on Programming concepts.
Evaluate the result of the following pseudocode expression using the library routine ROUND:
Value ← ROUND(7.625 * 2, 1)
Determine the final value of Total after the following nested loops are executed:
Total ← 0
FOR Outer ← 1 TO 3
FOR Inner ← Outer TO 3
Total ← Total + 1
NEXT Inner
NEXT Outer
Identify the most appropriate basic data type for a variable that stores whether a system alarm is currently 'ON' or 'OFF'.
Evaluate the result of the following pseudocode string handling operations:
Title ← "IGCSE2026"
Result ← SUBSTRING(UCASE(Title), 1, 5)
Identify the most appropriate basic data type for a variable that stores the number of items currently in a shopping basket (e.g., \( 12 \)).
Write your answer out first, then check it against the worked solution.
A variable X has an initial value of \( 10 \). State the final value of Y after the following pseudocode is executed:
IF X > 5 THEN
IF X < 15 THEN
Y ← 20
ELSE
Y ← 30
ENDIF
ENDIF
Write your answer out first, then check it against the worked solution.
Identify the resulting value and the final data type of the variable LogicFlag in the following statement:
LogicFlag ← (25 DIV 4) < (15 MOD 6)
Write your answer out first, then check it against the worked solution.
A programmer is developing a software module to manage a sequence of temperatures. The system needs to process these values to identify trends and ensure data integrity.
(a) Write pseudocode for a function named FindThresholdCount. The function should:
- Accept two parameters: an ARRAY of 50 REAL numbers named TempData and a REAL value named Threshold.
- Iterate through the array and count how many temperatures are strictly greater than the threshold.
- Return the total count.
(b) The system needs to validate user input for a temperature reading. Write pseudocode for a procedure named GetValidTemp that:
- Repeatedly prompts the user to enter a temperature.
- Uses a post-condition loop to ensure the temperature is between \(-50.0\) and \(150.0\) inclusive.
- Stores the valid input in a global variable named CurrentTemp.
(c) Explain the difference between a function and a procedure in terms of how they provide results back to the calling part of the program.
Write your answer out first, then check it against the worked solution.
A software developer is creating a routine to validate user inputs during the registration process.
(a) Define a FUNCTION called CheckLength that receives a string InputString and an integer MinLength as parameters. The function should return TRUE if the string length is greater than or equal to the minimum length, and FALSE otherwise.
(b) Write pseudocode to call this function within a REPEAT ... UNTIL loop that keeps asking the user for a password until it meets a minimum requirement of \(8\) characters.
Write your answer out first, then check it against the worked solution.
* The content provided by thinka is generated by AI and may not always be accurate or up-to-date. Please use it as a supplementary resource and verify with official materials.
You've seen the model answer. Now get yours marked.
This page can show you how a good answer looks. It cannot tell you what your answer was missing. thinka marks your written work against the real mark scheme in about 15 seconds.
Want more questions like these? Get a fresh set on this topic, marked as you go.
Practise More