Validation (Edexcel GCSE Computer Science): Flashcards

📚Flashcards
Validation
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

13 cards from this deck

Show

What is validation in programming?

Ensures data received is suitable for processing

Garbage in, garbage out principle

Bad data input produces bad/unreliable results

Length check definition

Verifies input has correct number of characters

Length check use cases

4-digit PIN, postcode validation

len() function purpose

Counts characters in input

Presence check definition

Ensures user entered something, not blank input

Presence check benefit

Prevents processing empty data that causes errors

Check empty input with len()

len(key) == 0

Alternative empty input check

key == ""

Range check definition

Verifies value falls between acceptable limits/boundaries

Range checks applicability

Work for both numbers and text characters

Operators in range checks

Relational (<, >, <=, >=) and Boolean (and, or) operators

Combining validation types

Use multiple checks together for thorough data validation

Join 100,000+ GCSE students studying Flashcards with us.

Select your subjects, and get access to A+ resources today.