algorithm design and problem solving Flashcards
whats pdlc
program development life cycle
steps followed in developing a program
what are the steps in pdlc and what do they stand for
analysis- understanding inputs needed and if enough resources available
design- technical and visual aspects of product
coding- programming implementation of design and analysis
testing- testing if program functions in intended way
what happens if program doesnt work in inteded way
process loops, goes back to analysis stage to find problem and how to fix it, this is called iteration
what are the three parts of the analysis stage
abstracting problem
decomposing problem
identifying requirements
describe the abstracting problem phase in analysis
abstraction- process of including only specific details of problem higher level of abstraction is more removed program is from direct control of cpu
describe the decomposing problem phase in analysis
process of breaking big probelm into smaller manageable chunks
describe the indentifying requirements phase in analysis
requeirements- specific mandatory conditions, must be carried out to be certain of final outcome
question on requirements usually passed to client or user by program designer
describe design stage
representing program before writing code, expresses how code would work what input are how logic would be coded etc.
involves similiar decomposition stage to the anaylisis stage, includes 3 representations structure diagram, flowchartm and pseudocode
what are the processes in the design stage
client feedback
ease of sharing- feedback from other programer
ease of modification- where to implement amendments
what are the three representations possible in design stage
flowchart
pseudocode
strucutre diagram
describe structure diagrams
represent sub systems, each level is less abstracted than above
helps to split and delegate development work to teams
help identify which part needs debugging
describe flowcharts and components
indicates inputs needed and process to be followed
-> = arrow represents control between shapes, order to be followed
rectangle = process, something being performed eg. declaring
parallelogram= input/ output of data
diamond= decision, results in two lines representing different outcomes eg. if statement
oval= start and stop
describe pseudocode
actual code, not understood by computer, only by humans
describe coding stage
written in ide- which organises code, debugs, supports many programming languages
has iterative testing in between coding stage
what is meant by iterative testing
testing carried out in coding stage
iterative= action carried in a loop until correct outcome
splitting up longer code into smaller chunks called modules
iterative testing applied to each module during coding phase
describe testing phase
make sure program works as inteded
iterative testing regularly carried out during coding, 6 different tests that can be carried out
unit testing
done by yourself, programmer, on pieces of code that you have written
integration test
putting all modules together testing complete system
system testing
testing software app you have built
dryrun testing
programmer goes over everyline of code and traces how program will bhave
alpha testing
prototype product tested by yourself
beta testing
near final product testing on sample target audience
what are the different testing that can be done
unit testing, integration test, system testing, dryrun testing, alpha testing, beta testing
what are the different test data
normal data, boundary data, extreme data, abnormal data
normal data
data that are inbetween ranges, should be exepted
boundary data
pair of values indacting lower and upper boundary 2 should be exepted and 2 shouldnt
eg. if range is between 1-10 including 1 and 10
0, 1, 10, 11 would be boundary data
extreme data
data at upper and lower bounds are inaccepted range
abnormal data
any data that should not be accepted, outside range, not correct data type
what processes of computer systems are included in structure diagram- decomposing problem
input
process
output
storage
describe input part of structure diagram
how system receives input
what kind of inputs needed
more than one source of input
does input depend on output
describe process part of structure diagram
primarily requires calculations/ decision/ retrieval of data
either serial or parallel
what does system do to get output
how is input turned into intended output
how many tasks does it take
describe output part of structure diagram
what kind of output does machine produce
what devices does machine use to deliver output
more than one form of output
describe storage part of structure diagram
where does data go after output
is it stored
what kind of data is stored
what is meant by a variable
stores data value in program, values can be changed, data varies
what is meant by constant
value in a program that isnt altered
what is an array
stores only same type of data, each element has a unique position, organised sequentially, fixed size, first and last position is known as upper and lower bound
what is meant by linear search
algorithm where an array is searched sequentially until searched value is confirmed presence or absence, stops either when value found, or when array ends, each value assigned true or false, true= has value
what is meant by bubble sorting
placing data elements in a particular order, in this case either from larger to smaller or vice versa
everytime a pair of value in data array are reordered= swap
each time full set of values in array have been examined and swapped if necessary= pass
what is meant by totalling
running total along program, adds current value by previous
eg. total= total + weight
what is meant by counting
increasing current value by 1 also called incrementing by 1
eg.
count= count + 1
what is meant by finding max and min
finding largest and smallest value in a array
what is meant by average
sum of all values/ number of values
what is validation
making sure data entered is sensible and meaningful, automatic check ensures data correct type and in range 6 types
range check
verifies if entered value falls within specified range
length check
validates data based on length or max numbers of characters eg. when writing a password
type check
confirms correct type of data enter
presence check
ensures data is present in expected place, eg when answering a form
format check
input uses specific format eg when entering data of birth must be using forward slashes
check digit
uses one or two specific characters in a sequence of digits to validate input eg. barcode
what are the different checks used in validation
range, length, type, presence, format, check digit
verification
process helps to check if data entered is correct by matching entered data to expected value
visual check
double entery check
describe visual check
user manually verifies data they inputed against original source of same data, not automated, protects against data errors
describe double entry check
automated verification check, system asks user to retype same data, compares both entered data must match
tracetables
method of manually following your code, recording values the computer assigns to each variable, identifies problems in algorithms and debugging a program