0% found this document useful (0 votes)
37 views

Algorithm Design and Problem-Solving

The document discusses the program development life cycle (PDLC) which involves analysis, design, coding, and testing stages. In the analysis stage, problems are decomposed and requirements identified. The design stage involves structure diagrams, flowcharts, and pseudocode to visually represent programs before coding. Coding implements the design, while iterative testing checks for correct output at each module. Testing the final program ensures it works as intended.

Uploaded by

itunesdabest49
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Algorithm Design and Problem-Solving

The document discusses the program development life cycle (PDLC) which involves analysis, design, coding, and testing stages. In the analysis stage, problems are decomposed and requirements identified. The design stage involves structure diagrams, flowcharts, and pseudocode to visually represent programs before coding. Coding implements the design, while iterative testing checks for correct output at each module. Testing the final program ensures it works as intended.

Uploaded by

itunesdabest49
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Computer Science

(0478)
Topic: Algorithm Design and Problem-Solving
Learning objectives
a) Understand that
every computer
system is made up of
a) Explain the
sub-systems, which
are made up of purpose of a given
a) Understand the further sub-systems algorithm
program
b) Understand how a b) Understand
development life problem can be standard methods
cycle, limited to: decomposed into its of solution
analysis, design, component parts
coding and testing c) Use different
methods to design
and construct a
solution to a problem
The program development life cycle (PDLC) or software
development life cycle (SDLC)

 A program takes shape after a lot of research,


analysis and designing. The word ‘life cycle’ is
representative of the stages that are done in order
to create a new product. This product, in our case,
is a program.
Stages of PDLC or SDLC
 The program development life cycle
(PDLC) is a simple representation of the
steps that are followed in developing a
program. This program may be anything
from a smartphone app to a website.

 Because the PDLC is a cycle , after testing


is complete, unless the original problem
has been completely solved, the process
loops back to the analysis stage to work
out what did not go as planned, and
design and implement a new solution.
This process is called iteration.
Stages of PDLC or SDLC
• Analysis • Coding
This is the first step of the PDLC and is As the name suggests, in
the process of understanding what program design this step is
exactly you need as inputs to ‘build’ your getting right into programming,
product and if you have enough (this stage is actually sometimes
resources.
referred to as implementation).
 Design
• Testing
This second step refers to thinking about
Now that the product is
the technical and visual aspects of your
finished, you test out your
product. A clear design will help realise
product to see if it functions the
the final product without ambiguity.
way you intended.
Analysis Stage
Abstraction
Identifying requirements
This process of including only the
One of the last steps under the
specific details of a problem and leaving
out the bits of the problem that are not analysis phase is to identify the
necessary to the situation is requirements of the problem at
called Abstraction. hand. Requirements are specific and
mandatory conditions that must be
Decomposition carried out in order to be certain of
the intended final outcome.
This process of splitting a bigger
problem (baking a cake) into smaller
manageable chunks (preparing, pre-
heating, mixing, pouring and baking) is
called decomposition .
Design stage
The design stage in PDLC refers to visually representing the
program (or the product) before writing the code. This visual
process helps to express how your code would work, what the
inputs are, how the logic would be coded. The design stage
involves the followings;
• Structure diagrams
• Flowcharts
• Pseudocode
Structure diagrams
• Structure diagrams are used to • Sub-systems are useful if a part of the
represent sub-systems that make up a overall system is not working as
system. Each sub-system is also split into intended, and a structure diagram can
smaller sub-systems. help identify which part of the system
• Structure diagrams are hierarchical in to debug.
nature. The final product is at the top- • When creating a system, structure
most level, with each level below diagrams also help to split and
showing that system broken down into delegate development work to
its sub-systems. Each level is a little less different teams to work on
abstracted than the level above, with simultaneously, reducing the overall
the bottom layer containing the least time taken to implement the full
abstraction and the most detail. system.
Structure diagrams

Phone

Process Output Storage


Input Module
Module Module Module

Voice Internal External


Touch Screen Speaker Headset Jack
Recognition Storage Storage
Flowcharts

• Flowcharts are another way of


visually representing a program
before it is written. A flowchart
indicates the inputs needed
(requirements) and the processes to be
followed (logic) that lead to the
output (final outcome). Flowcharts
use a standard set of symbols to aid
communication and understanding.
Flowchart Samples
Pseudocode
• The word ‘pseudo’ means ‘false’ ­– and ‘pseudocode’ means
exactly that: ‘false code’. Pseudocode resembles actual code
but cannot be understood by a computer.
• It is written in a human-readable format that makes more
sense to a non-programmer than an actual program would.
Since this is closer to real code, programmers find it easy to
write code after a design process that uses pseudocode.
• And because there is less interpretation needed, pseudocode
can make handing over work between team members
smoother.
Coding Stage
 The coding phase of the PDLC/SDLC is • Adds colour coding and
also referred to as the indents to help organise code.
‘implementation’ phase. This is
because this phase implements the • Helps you identify errors using
design from the previous stage of the a tool called a debugger .
cycle. • Usually supports many
 Program code is usually written in programming languages
an integrated development making it a versatile
environment (IDE). There are many
application to have on your
advantages to writing using an IDE,
but they include; device.
Iterative testing
 The word iterative describes any action that is carried out in a loop
until it produces the correct outcome. In coding, a program is tested
until it meets requirements and produces correct output. If it does
not produce the intended output, it must be analysed, designed and
written again until the correct output is achieved.
 As you saw in the interactive above, part of ‘good coding practice’
involves splitting up longer code into smaller chunks called modules.
Iterative testing is also applied to each of these modules during the
coding phase, in order to make sure each chunk of code works
properly separately, before eventually being put together to form the
complete final code.
Testing Stage
 This is the final stage of the PDLC/SDLC.
Importance of test data
You have analysed, designed and coded,
but how do you make sure your  Just as it can take a team of
system/product actually works the way people to write a program, there
you want it to? It is by testing it. is also a specific team of people
 Testing is part of our everyday lives. As who are in charge of testing.
you walk down the aisles of a  With the various types of testing
supermarket, you may sometimes see a
‘sample’ of a new product they are involved, a number of teams
currently marketing. For every new car have the job of making sure that
model, a prototype is built and ‘crash the product works as intended.
tested’ to address any safety issues and
give the car its safety ratings.
Types of Test data
• As an example, imagine you are testing • Extreme data
data for people’s age between 21 and 74 Data at the upper and lower bounds
inclusive. of the accepted range. (would be
• Normal data ~21–24 and ~71–74.)
Data that is within an accepted range • Abnormal data
(for example, any age between 21 and Any data that is not accepted, either
74 inclusive). outside the accepted range or the
• Boundary data incorrect data type. (would be 20 or
A pair of values indicating the upper and less, 75 or greater, or any data that
lower bounds that should is not an age.)
be accepted and a pair of values that
should be rejected. (would be 21 and
74 accepted, 20 and 75 rejected.)
See videos
 https://www.youtube.com/watch?v=VUGFN-kpVqY&list=PL1xw3Nu1lKNXKXGXAE7w-KkfUPR3r3ye1&index=1

 https://www.youtube.com/watch?v=BYbQiSpPiPA&list=PL1xw3Nu1lKNXKXGXAE7w-KkfUPR3r3ye1&index=2

 https://www.youtube.com/watch?v=kBSOOSi0zTQ&list=PL1xw3Nu1lKNXKXGXAE7w-KkfUPR3r3ye1&index=3

 https://www.youtube.com/watch?v=oBpaleb8Py0&list=PL1xw3Nu1lKNXKXGXAE7w-KkfUPR3r3ye1&index=4

 https://www.youtube.com/watch?v=cY0GjVzmo8s&list=PLCiOXwirraUCKOH2duohyLRk9O75bgUdI

 https://www.youtube.com/watch?v=j51R215dNs0&list=PLCiOXwirraUCKOH2duohyLRk9O75bgUdI&index=2

 https://www.youtube.com/watch?v=UR4ZWB1B8cU&list=PLCiOXwirraUCKOH2duohyLRk9O75bgUdI&index=3

You might also like