Preconditions for Devising Problem Solutions (OCR A-Level Computer Science): Flashcards

📚Flashcards
Preconditions for Devising Problem Solutions
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

14 cards from this deck

Show

What are preconditions?

Conditions that must be met before a program or function executes correctly

Type of precondition: specific data types/formats/ranges

Input Requirements

Type of precondition: hardware/software conditions

System Requirements

Type of precondition: environment/state conditions

Contextual Assumptions

Why do preconditions ensure valid input?

They avoid errors by checking inputs meet required conditions

How do preconditions define problem scope?

Clarify what the program should and shouldn't handle

How do preconditions improve efficiency?

Allow design of solutions optimised for specific conditions

First step in determining preconditions

Analyse the problem description

Example: Password validation minimum length

At least 8 characters

Example: Password validation content requirements

One uppercase, one lowercase, one number

Example: Sorting algorithm input precondition

Must be a list of comparable elements

How preconditions affect algorithm choice

Influence which algorithms/data structures are appropriate

How preconditions affect efficiency

Known preconditions allow optimisations (e.g., sorted input)

Common mistake: assuming valid input without validation

Can cause runtime errors

Join 100,000+ A-Level students studying Flashcards with us.

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