
Data Validation
Quiz by GCSE Computer Science Teacher 4
GCSE (AQA)
Computer Science
English National Curriculum
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measures 1 skill from
Measures 1 skill from
Track each student's skills and progress in your Mastery dashboards
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
10 questions
Show answers
- Q1What is meant by input validation?Validation is making sure the users input is in the correct formatValidation is verifying the identity of a userEnsuring the user is using an input device such as a keyboardValidation is testing for syntax errors30s3.2.12.a
- Q2How could you add validation to make sure the user can only enter whole numbers for age?TRY INT_TO_STRING(age) CATCH OUTPUT("You must enter your name")TRY STRING_TO_INT(age) CATCH OUTPUT("You must enter your name")TRY OUTPUT("You must enter your name") CATCH STRING_TO_INT(age)TRY STRING_TO_INT(age)30s3.2.12.a
- Q3Why do we need input validation?To avoid syntax errorsTo avoid run-time errorsTo make sure the program is fully testedTo make sure the person using the program is allowed30s3.2.12.a
- Q4What is user validation?Ensuring the correct user is accessing the programMaking sure the users input is in the right formatChecking for logical errors in a programTesting a program by getting users to try it30s3.2.12.a
- Q5Which of these is a type of input validation?All of theseRange checkData type checkMinimum length30s3.2.12.a
- Q6How can you check if the length of the string is empty?IF (password) == 0: OUTPUT ("Password accepted")IF (password) == 0: OUTPUT ("You must enter a value")IF POSITION(password) == 0: OUTPUT ("You must enter a value")IF LEN(password) == 0: OUTPUT ("You must enter a value")60s3.2.12.a
- Q7What the program is doing?It's reading all of the line in scores.txt without checking if the file existsIt's loading the function to find the scores text fileIt's writing the scores to fileIt's checking whether the file exists30s3.2.12.a
- Q8The test is marked out of 100. Which line of code makes sure the user enters a number between 0 and 100?IF mark < 0 OR mark > 100 OUTPUT "The score must be between 0 and 100IF mark < 1 OR mark > 100 OUTPUT "The score must be between 0 and 100IF mark < 0 AND mark > 100 OUTPUT "The score must be between 0 and 100IF mark <= 0 OR mark >= 100 OUTPUT "The score must be between 0 and 10060s3.2.12.a
- Q9How can regular expressions help with input validation?They can only be used for passwords so it will not always helpIt will create a set of rules for expected input that the users input can be compared withIt will delete any input that doesn't exactly matchIt will only allow users to type expressions that match the conditions60s3.2.12.a
- Q10Why is input validation so important on websites or web-based applications?To keep credit card information secureTo make it easier for SQL injectionsTo help the user log in quickerTo prevent SQL injections from happening60s3.2.12.a