Unit 8 - Logic✔️ Flashcards
define data validation?
is an automatic check to ensure that data entered is sensible and feasible however it can not ensure data is accurate but only check the data entered is reasonable
why is data validation important when programming?
stops unexpected or abnormal data from crashing your program
define what a range check does?
Checks the data falls between an acceptable upper and lower value, within a set range
define what a type check does?
Checks that the data entered is of an expected type, e.g. text or a number
define what a length check does?
Checks the number of characters meets expectations, e.g. an 8 character password
define what a presence check does?
Checks that the user has at least inputted something, stopping them from accidentally entering nothing
define what a format check is?
An extra digit added to a number which is calculated from the other digits, this ensures the rest of the number has been entered properly
define data verification?
is used to double-check that the data has been typed in correctly eg a user setting a new password may be asked to enter it twice
what are authentication routine used for?
used to make sure a person is who they claim to be eg being asked to enter a User ID
why do programs need to be maintained?
-improve the code
-fix bugs and add new features
how can programs be written so that they can be easily maintained?
-commenting
-indentation
-use of sub programs (functions and procedures)
-using appropriate naming conventions
what is the point of indentatin?
makes it possible to easily see which lines of the code are part of different structures
what is the point of commenting in your code?
-helps other programmers to understand your code
-helps with difficult to understand parts
-at the start of functions to explain what it does
what should naming conventions be?
it is important to use meaningful names for variable ,functions and procedure so they are easy to understand
Example of high-level programming language?
Python, Visual Basic, C#, Java, C++
Example of Markup languages?
HTML, XML
Example of a Low-level Programming languages?
Assembly language
Example of query language?
SQL
What is machine code?
In first computers,all programs were written in machine code - instructions were written in binary (101011001001) - each instruction did one very small task but writting programs was difficult and time -consuming
Features of assembly language?
• Assembly language is processor-specific
• It has to be translated into machine code before it can be executed
• As each instruction corresponds directly to a machine code instruction, it is known as a low-level language