COMPUTER SCIENCE CAFÉ
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
LEARNING IS A JOURNEY
7.5 ALGORITHM DESIGN
Picture
ALGORITHM DESIGN AND PROBLEM SOLVING
COMING SOON
Topics from the Cambridge IGCSE (9-1) Computer Science 0984 syllabus.
7.5 ALGORITHM DESIGN AND PROBLEM SOLVING
VALIDATION
SECTION OBJECTIVES
7.5 (a) Understand the need for validation checks to be made on input data and the different types of validation check
 Including:
– range check
– length check
– type check
– presence check
– format check
– check digit
​– the purpose of each validation check and writing algorithms to implement each validation check
Validation is the process of checking that an input from the user meets the criteria expected and is therefore most likely valid data. For example, if you ask the user their age then you expect a number to be typed in, a validation check will check that the input was a number.  The below TABs explain each check and give an example in Python and Pseudocode.
  • RANGE CHECK
  • PYTHON
  • PSEUDOCODE
<
>
A range check checks if the data given is within a pre-set range. For example, if you were asking for the age of a GCSE student at school you might set the acceptable range to be between 12 and 18

    
  • LENGTH CHECK
  • PYTHON
  • PSEUDOCODE
<
>
Checks that the number of characters entered is within a given length. For example, we could set a length check to ensure a telephone number entered if more that 5 digits long.

    
  • TYPE CHECK
  • PYTHON
  • PSEUDOCODE
<
>
Checks the type of data entered, for example, if it is text or a number. If you ask the user their age the Type check will check that a number was entered and not text.

    
  • PRESENCE CHECK
  • PYTHON
  • PSEUDOCODE
<
>
The presence check ensures that fields are not left blank, in other words data must be present. For example, you cannot leave an email address filed blank.

    
  • FORMAT CHECK
  • PYTHON
  • PSEUDOCODE
<
>
The format check checks the structure of the data entered matches a pre-set value. For example, a student ID might be two letters followed by 4 numbers (ST1001) the format check will check that the user input follows the structure expected.

    
  • CHECK DIGIT
  • PYTHON
  • PSEUDOCODE
<
>
A check digit is a number added to the input value that can be calculated from all or part of the input value. Check digits are used on barcodes.

Imagine you have this 4-digit number 3756, we can simplify how a check digit works with the following algorithm:
Add the value of the second number (7) to the first number (3): 10
Add the value of the third number (5) to the answer (10): 15
Add the value of the fourth number (6) to the answer (15): 21
Divide(21) by 7: 3
Add the answer to the end of the original number: 37563
This is the new number, and the last digit is the check digit: 37563. Using the same algorithm, any number entered mush equal the last digit when the calculation is done.

    
A combination of the checks above is normally needed to ensure accurate data validation.
VERIFICATION
SECTION OBJECTIVES
7.5
(b) Understand the need for verification checks to be made on input data and the different types of verification check
 Including:
– visual check
​– double entry check
The process of verification is to check the data is accurate, in its original form as expected. Where-as data validation will check the data is within pre-set parameters, data verification attempts to check if the data is correct.

Visual check - this is a visual check done by the user, to proofread and check the data entered or received is correct.
Double entry - this is when the user is asked to enter the data twice, this is frequently seen when completing online forms, they will often ask you to enter your email address twice, a comparison is then done and if both email addresses match, then the form is accepted. This is done on fields such as email addresses because people often mistype and get the email address incorrect.

Data validation would not be able to check if you spelt your name wrong, whereas data verification should help pick this error up.
< < < SECTIONS > > >
7.1
7.2
7.3
7.4
7.5
7.6
7.7
7.8
7.9
Picture
SUGGESTIONS
We would love to hear from you
SUBSCRIBE 
To enjoy more benefits
We hope you find this site useful. If you notice any errors or would like to contribute material then please contact us.