Validation checks are used to ensure that data that is entered is reasonable and expected.
Iteration is used to ensure the validation checks are implemented correctly.
Keywords
validation
checking that data is acceptable by comparing it against a set of criteria
crash
when a program suddenly stops working and closes unexpectedly, often due to an error it cannot recover from
A common mistake
Mistake:A program will automatically ask people to try again if data is invalid.
In fact:The program will only ask for data to be input again if it has been programmed to do so; otherwise it will run with invalid data and may crash.
Check what you learned
From Oak National Academy's exit quiz. Choose every answer that is right.
A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0.Read the licence
Lesson 2 of 2 · Lower secondary, ages 11 to 14
Writing a text-based program
By the end:I can create a text-based program from an algorithm that includes input and output.
An algorithm is a sequence of steps that can be followed to do a task.
A program is a set of commands that can be run by a computer in order for it to do a task.
All programming languages have rules for syntax that must be followed so that the program can run.
The print() function is used to output information from a Python program.
The input() function is used to input data from the user into a Python program.
Keywords
algorithm
a set of step-by-step instructions to solve a problem
program
a set of commands that can be run by a computer in order for it to do a task
syntax
the precise way that a program must be written to be understood by a computer
A common mistake
Mistake:Pupils will modify their code to provide input directly in to the input() function, for example, user = input("Aisha"), rather than typing when asked as the program runs.
In fact:The computer follows the instructions of a program. Input that a user has to type in should only be entered when the program runs. This allows different users to provide different inputs without changing the program in any way.
A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0.Read the licence
The wording comes from each publisher. The layout and the links to your syllabus are ours.