paper 1 Flashcards
(114 cards)
What is in structured programming?
- decomposing into manageable sub tasks, which can be written individually as sub routines
- modularising (using subroutines)
*using parameters
*using return variables
*using local variables
Why use structured programming?
- easier to test structured programs as each module can be tested individually
- individual subroutines can be fixed and updated, without affecting the rest of the program
- the subroutines can be re-used for future programs
- programmers can work on one program, as each module can be written individually
*coding may be easier
What is authentication?
the process of check a user is who they say
What is INPUT validation?
checks that the data meets a certain criteria before passing into the program
What are the types of input validation?
*range: checks that the data is within a specific range
*presence: checks that data has actually been entered
*format: checks that the data has the correct format
*look-up: checks the data against a table of acceptance values
*length: checks the data correct length
why should programs be easy to maintain?
- change parts of the source code, without the risk of causing problems elsewhere in the code
How can you improve the maintainability of the code?
*comments explaining key features
*indentation to clearly see the flow of the program
*only using global variables where necessary, as they affect the rest of the code, variables with local scope will not affect the rest program, when other programmers change this variable it won’t affect the other part so he program
*variable names are enough for the reader to understand
What are the different types of errors?
*syntax error
*logical error
What is a syntax error?
When the compiler or interpreter doesn’t understand something you have typed because it doesn’t follow the rules or grammar of the programming language
How would you use the python in range function for pseudocode?
Why are meaningful identifiers names used?
Describes the purpose of the variable
makes the code easier to understand and maintain
What are the different types of test data ?
🟢normal data
🟢boundary valid data
🟢boundary invalid data
🟢erroneous data
What are trace tables ?
Helps to find logical errors
What is time efficiency in algorithms?
Measures things like the number of time memory was accessed and the number of CPU cycles taken to execute commands
Define ‘algorithm’
The sequence of steps that can be followed to complete a task
Define decomposition
The breaking of a problem into a number of sub problems, so that each sub problems accomplishes an identifiable task, which might itself be further subdivided
“Abstraction “
The process of removing unnecessary detail from a problem
Why are data types used?
Each data type is allocated a different amount of memory, using the correct data types makes the code more memory efficient, robust and predictable
Define constants
Define variables
What is an algorithm?
An algorithm is a sequence of steps that can be followed to complete a task.
What is decomposition?
Breaking a complex problem into sub problems until each task is manageable, then solving each one individually
What is abstraction?
Removing unnecessary detail from a problem so you are left with important bits, simplifying the task
What is algorithmic thinking?
A logical way of getting from the problem to the solution. Acknowledging if certain bits of code can be reused