0% found this document useful (0 votes)
4 views18 pages

Topic 2

Software construction

Uploaded by

afiqah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views18 pages

Topic 2

Software construction

Uploaded by

afiqah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

SOFTWARE CONSTRUCTION

CBSC4103
DR. MARIAYEE DORAISAMY
TOPIC2
PROBLEM DEFINITION

PROBLEM SOLVING PROCESS


(Problem Definition – Solution Analysis – Idea
Generation – Ideas Analysis – Decision making -
Implement )

PROBLEM SOLVING STRATEGIS


(Linear / Iterative/ Parallel / Dynamic

ALGORITHM
(Characteristics / Pseudo code)

CONTROL STRUCTURE
(iterative / recursive )
DEFINITION
What is a problem ?
A situation, person, or thing that needs attention and needs to be
solved.

What is a problem in context of computer science?


The most important aspect of computer science is problem solving, an
essential skill for life. We study the design, development and analysis of
software and hardware used to solve problems in a variety of actual
scenario.

What is Problem Solving ?


Is a step by step process that followed in order to
solve a problem and achieved desired goal.

Problem Solving and Software Construction ?


The stages of problem solving falls within the core
of software construction which relies on problem
solving methodologies and program development
task based on the algorithm.
PROBLEM SOLVING PROCESS

Problem Decision
Idea
To identify the Determine which idea to be
Generate all the
problem taken to solve the problem
relevant idea to solve
problem

Solution Implement
Ideas

Definition Generation Making

Analysis Analysis Idea


Analysis the solution Analysis the Implement the idea in the
that could solve the generated idea by real environment.
problem looking at the Pro,
Cons, benefits and
etc.
PROBLEM SOLVING PROCESS - EXAMPLE

Problem Decision
Idea
Dengue Problem Assume Fogging is most
• Fogging
increasing at the suitable idea then make the
• Gotong-Royong
residential area decision by choosing Fogging
• Penalties
to solve the problem.
• Continuous Monitoring

Solution Implement
Ideas

Definition Generation Making

Analysis Analysis Idea


Analysis the Analysis each given Implement the fogging
situations that could idea by looking at the process in the residential
solve the dengue pros, cons, benefits, area
problem in the cost incur, time taken.
residential area Can put up in a table
form.
Example on how a problem can be solved by using the problem solving processes.

Step 1: Identify and define the problem. Step 4: Decide on a solution.

• Project Manager realised the project running out • Based on the SWOT Analysis result, chose one of the best problem
the schedule solution

Step 2: Generate possible solutions. • Let say, out of three generated problem solution, the solution of -
Add in more programmers in to a project is more reliable to solve
• Add in more programmers in to a project the running out schedule.
• Revise back each development module Step 5: Implement the solution.
• Request additional time from business owner • Next, you implement the solution by adding more programmers who
Step 3: Evaluate alternatives. has expertise and experience to develop the software more faster.

• Evaluate each possible solutions by deciding the Step 6: Evaluate the outcome.
pros and cons. Once implemented the solution, now you evaluate whether the project
back to estimated schedule or not .
• Use SWOT (Strengths, Weaknesses, Opportunities,
and Threats) analysis for each possible solution. • If yes , then you managed to solve the problem.
(one of the technique. You may use other • If no, then you may try to adapt other solution that was generated
techniques as well) earlier.
PROBLEM SOLVING
STATEGIES
Can be unidirectional or
1
Linear Strategy bidirectional

2 Tasks are carried sequentially

Step by step action to solve a


3
problem.
Task A Each task depending on the
4
preceding one
Task B There is interactivity relationship
5
between the one tasks to another.
Task C

Task D

VTask E

The Linear Problem Solving Diagram


Problem : How to do Vaccine Registration
Solving Strategies : Linear
Solution:
1. Go to particular website
2. Click on Vaccine Registration
3. Fill-up Personnel Information
4. Fill-up Health Information
5. Fill-up Vaccine Location
6. Send the application
7. Get the sending confirmation on application
8. Checking the vaccine confirmation status
9. Confirm the vaccination on given date
10.Get the vaccine accordingly.
The iterative approach to problem solving
1 is based on gradual improvements to a
Iterative Strategy very basic design

It focuses on priority of the tasks in any


2 problems.

To improve on existing wing designs and


3 only had to solve the control problem from
scratch

It requires enough knowledge of whatever


field you are working in to not only solve
4 the simplified problems, but to know which
Task A Task E
problems to solve and in what order.

The real power of an iterative approach is


found in identifying the correct starting
Task B Task D point for your problem and then solving
5 that particular portion of the problem first,
so that the solution can be used to build a
Task C solid foundation for solving the rest of the
problem.

The Iterative Problem Solving Diagram


1 It runs simultaneously
Parallel Strategy
2 It could be done independently

Tasks in problem solving run


3
parallel
It reduce the problem solving
4
time

Task A Task C

Task B Task D

VTask E

The Parallel Problem Solving Diagram


It is essentially just an optimization
1
Dynamic Strategy technique
It is a method for solving problems by
2
breaking them down into a collection of
simpler sub problems

By solving each of those sub problems


3
just once, and storing their solutions

The next time the same sub problem


4 occurs, instead of recomputing its solution,
you simply look up the previously
computed solution.

5 This saves computation time at the


expense of a (hopefully) modest
expenditure in storage space.

The Dynamic Problem Solving Diagram


ALGORITHM
Algorithm
• It is a procedure or formula for solving a
problem, based on conducting a sequence
of specified actions.
• is a finite sequence of well-defined, computer-
implementable instructions, typically to solve a
class of problems or to perform a computation

• Algorithms are always unambiguous and are


used as specifications for performing
calculations, data processing, automated
Example of Pseudo Code : reasoning, and other tasks.

1. Start • Two widely used algorithm techniques are


2. Declare Gender Pseudo code and Flow Chart.
3. Enter the type of Gender

4. Check the Gender


4.1 If Gender is equals to Female then
print “Your are eligible to enter the Beauty Pageant Competition”
4.2 If not then
print “Your are not eligible to enter the Beauty Pageant Competition”
4.3 EndIf
5. End
Characteristics of Algorithm

Step by step All the steps


Not be Complete Executable
order define to
ambiguous
terminating
the process
CONTROL STRUCTURE
ITERATIVE RECURSIVE

• Looping process • Selection process


• Three iterative structure • Recursive structure such as
such as While , Do-While Bi-Selection (IF- ELSE) , Multi
and For Selection (IF – ELSE IF, ELSE)
and Nested Selection (IF – IF –
• Example : ELSE – ELSE)
• Example :
• For (i=1; i <= 5; i++)
• While (i <=5) If (gender = = “Female” )
printf( “You are Eligible );

else
printf( “You are Not Eligible );
Revision Questions
Topic 2
❑ What is Problem?
❑ What is Problem Solving?
❑ What is Problem Solving Process ?
❑ What is Problem Solving Strategies?
❑ What is Algorithm?
❑ What is characteristics of Algorithm?
❑ Types of Control Structure?
Thank You

You might also like