1. Which checks whether an age lies between 0 and 120?
- Range validation
- Spell checking
- Compression
Check the answer and reasoning
Range validation
A range check rejects values outside specified bounds, though an accepted value may still be false.
CS / IGCSE
Variables have data types, and programs use arithmetic, Boolean conditions, loops, arrays and procedures. Pseudocode communicates an algorithm without requiring one executable language.
Variables have data types, and programs use arithmetic, Boolean conditions, loops, arrays and procedures. Pseudocode communicates an algorithm without requiring one executable language.
Decomposition, validation, verification and systematic test data support reliable programs. Normal, boundary and invalid cases test different behaviours; a trace table reveals how state changes.
A loop adds integers 1 through 4 to total=0. What is the final total?
The running totals are 1, 3, 6 and 10.
Predict the worked result before calculating. Change one input, record the new result, and explain which assumptions still hold.
Use the prediction activity below; a local model appears only where it supports this topic.
Range validation
A range check rejects values outside specified bounds, though an accepted value may still be false.
10
The running totals are 1, 3, 6 and 10.
No
Tests sample behaviours; rigorous reasoning and suitable coverage are still needed.