Professional Documents
Culture Documents
SWE1301: Introduction To Problem Solving and Software Development
SWE1301: Introduction To Problem Solving and Software Development
Lecture Outline
SWE1301: Introduction to Problem
Solving and Software Development • Solution Organization Tools
• Problem analysis chart
• Pseudocode
• Algorithm
• Structure of Algorithms
• Flow chart
• UML diagrams
Lecture 03: Solution Planning
Venue : CIT Theatre
Presented by: M. I. Mukhtar
• Functions are used for basic tasks that are used • String functions: used to manipulate string
repeatedly in the problem solving process. variables. For example, joining strings together,
• Each language has a set of functions within it. finding the length of strings.
1
12/14/2021
2
12/14/2021
Numeric Expression
Computer Expression
12/14/2021 SWE1301: Problem Solving and Software Development - MIM 9 12/14/2021 SWE1301: Problem Solving and Software Development - MIM 10
12/14/2021 SWE1301-Problem Solving and Software Development- MIM 11 12/14/2021 SWE1301-Problem Solving and Software Development- MIM 12
3
12/14/2021
12/14/2021 SWE1301-Problem Solving and Software Development- MIM 13 12/14/2021 SWE1301-Problem Solving and Software Development- MIM 14
12/14/2021 SWE1301-Problem Solving and Software Development- MIM 15 12/14/2021 SWE1301-Problem Solving and Software Development- MIM 16
4
12/14/2021
Algorithms Algorithms…
• Algorithms are sets of instructions for the • Writing incorrect instructions to the computer
computer. will lead to either of the following:
• an error message,
• An Instruction is an order given to a computer • wrong answer,
processor by a computer program. • no answer at all.
• Computer programs are written by a computer
programmer.
12/14/2021 SWE1301-Problem Solving and Software Development- MIM 17 12/14/2021 SWE1301-Problem Solving and Software Development- MIM 18
Algorithms… Algorithms…
• Algorithm is defined as an unambiguous and • Setting up the algorithms is probably the
precise set of steps for solving a problem (or hardest part of problem solving on the computer
sub-problem) in a predetermined amount of because;
time using a finite amount of data.
• Algorithm refers to the sequence of • The instructions cannot assume anything,
instructions that must be followed to solve a cannot skip steps, must be in the correct
problem. order, must be executable one step at a
time, and must be complete.
• Algorithms are generally created independent of
underlying languages: • If the instructions are not properly ordered,
• an algorithm can be implemented in more the computer will, nevertheless, execute
than one programming language. them in the order given, and the result will
• For each problem or class of problems, there be wrong.
may be many different algorithms.
12/14/2021 SWE1301-Problem Solving and Software Development- MIM 19 12/14/2021 SWE1301-Problem Solving and Software Development- MIM 20
5
12/14/2021
• Effectiveness: Each step must be carried out in • Complete account for all inputs & cases
finite time.
• Precise: An algorithm should provide only one
• Output: An algorithm must have output. way to interpret the instruction.
12/14/2021 SWE1301-Problem Solving and Software Development- MIM 23 12/14/2021 SWE1301-Problem Solving and Software Development- MIM 24
6
12/14/2021
12/14/2021 SWE1301-Problem Solving and Software Development- MIM 25 12/14/2021 SWE1301-Problem Solving and Software Development- MIM 26
• Using them :
• the programmer can test the solution for bugs
(desk checking).
• the programmer can go on to code the problem
into a computer language for entry into the
computer.
• The programmer is ready to move to step 6 of the
problem solving step.
Step 6: Coding
• Evaluate the solution &
Testing
12/14/2021 SWE1301-Problem Solving and Software Development- MIM 27 12/14/2021 SWE1301-Problem Solving and Software Development- MIM 28
7
12/14/2021
Coding Testing
• Coding is the act of writing the solution of the • When a solution is complete, it is important to
problem into a computer solution. test it to make sure no errors in logic or in the
setup of the expressions and equations.
• If the programmer follows the proper steps in • This can be carried out manually before
developing the solution, there should be few coding—Desk Checking
logic errors in the program, and the testing and
coding should go quickly. • To test a solution, the programmer selects test
data, a set of values for the input data, and
• Most syntax errors can be from works them through every step in the solution.
misunderstanding of the original problem.
• It is important to select test data carefully, so
the correctness of the results can be checked
with as much accuracy as possible.
12/14/2021 SWE1301-Problem Solving and Software Development- MIM 29 12/14/2021 SWE1301-Problem Solving and Software Development- MIM 30
Lecture Summary
• The efficiency of the computer relies on the
effectiveness of the programmer or the user.
12/14/2021 SWE1301-Problem Solving and Software Development- MIM 31 12/14/2021 SWE1301-Problem Solving and Software Development- MIM 32