Paper 23 Flashcards
Define decomposition
Breaking a problem down into subproblems
Define abstraction
Removing unnecessary detail from a problem
define casting
casting is changing the datatype
define iteration
code is repeated(“looped”) until specefied conditions are met
A procedure
doesn’t return a value
A function
returns a value
What are the properties of a well-structured program
meaningful variable names-easy to keep track of what is happening
indentation-clarity as the blocks are separated
comments can be used to explain what you are intending to do
Pros of structured programming
The code is more readable and easier to understand
what is a logical error?
Logical erros occur when teh programs execution appears to run as normal but not as the programmer intended
What is a syntax error?
the syntax of a language is the collection of rules that form its struture.A syantax error occurs when the programer breaks these rules
define trace tables?
Used to test for logical errors
what is validation?
Checking data meets a set f criteria before you process it
e.g. length check
What is an IDE?
Integrated development environment-an application that provides a selection of tools for programmers allowing them to code using additional tools in one place
Psuedo code for linear search
current = 0 found = false last = length(list)-1
REPEAT UNTIL found = true OR current > last IF list [current] = target found = true Return current ELSE current = current + 1
Big o for linear and binary search
worst case :