CH 1 - PROBLEM SOLVING (Module 1) Flashcards
5 steps of problem solvin cycle
- analyzin the problem
i. understand the problem well
ii. amalyze the problem - developin an alorithm
i. think of possible solutions
ii. follow a modular approavh
iii. identify operations for solutions - codin
i. code program using appropriate control structures - testin and debuin
i. test and debu
ii. complete your documentation - maintaining and implementin
i. implement your code
ii. maintain your proram
what is codin
codin is the technical word fro writin a proram. thji step is to translate the aloritm into a prora,min lanuae
testin
estin is the process of findin errors in the proram
debuin
the process of correctin errors found durin the testin process
documentation
it is intended to allow another person or prorammer to understand the proram at a later date
miht also conain a adetrailedx description of what the proram does and how to use the proram
maintainin a aproram
involves modifiyin the prorams to emove previuouly undetected errors, to enhance the proram with different features or functionality, keepin the proram up to date with ivernment reukationso rcompany policies
decomposition
the process of breakin down a bi or complex problems into a set of smaller sub processes to allow us to describe, understand or execute the problem better
2. breakin a lare problem into more manaeable sub problems
what does decomposition involve
- dividin a task into a sequence of subtasks
2. identifyin elemts or parts of a complex system
what is the need of decomposition
lare problems are disproportionately harder to solve than smaller problems
algorithm
the set of rules that define how a particular problem can be solved in finite number of steps
-contains finite steps each of which may require one or more operations
constraints on type of operations an alorithm van include
- each operation must be DEFINITE
- must be clearly defined what should be done
- cant say add 3 and a, since the operation is not defined - each operation must be EFFECTIVE
- each step should also be able to be done by pen and paper in finite amount of time
- arithmetic operators on interes are effective but on real numbers, its not effective
since vales come in infinitely lon decimal expansions - each operation must be FINITE
- the alorithm should terminate after a finite number of operations
characteristics of a good algorithm
- PRECISION - steps should be precisely define
- UNIQUENESS - every step should uniquely contribute to the algorithm
- result of a step is unique and depends on input and the results of the previous steps before it ONLY - FINITENESS - must be finite and should terminate
- INPUT - algorithm requires specific input to work on
- OUTPUT - algorithm produces output as per input received and stated objectivities
- OUTPUT -
components of an algorithm
- INPUT - provoided by user or elf obtained like readin from a file
- PROCESSIN -
- OUTPUT - the objective of the algorithm
program and algorithm relation
a program is the expression of an algorithm in a prorammin lanuae
algorithm can be expressed in what ways
- FLOWCHART
2. PSEUDO - CODE