Top Banner
PROGRAM DEVELOPMENT CYCLE
21
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chap6

PROGRAM DEVELOPMENT CYCLE

Page 2: Chap6

Problem Statement:

Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this stage include Algorithms and flowcharts for identifying the expected steps of a process. Therefore to solve any problem,

• Collect and analyze information and data • Talk with people familiar with the problem • If at all possible, view the problem first hand • Confirm all findings

Page 3: Chap6

An Algorithm: Baking a Cake

Algorithm: A predetermined series of instructions for carrying out a task in a finite number of steps.

Page 4: Chap6

An Algorithm: Baking a CakeAlgorithm: A predetermined series of instructions for carrying out a task in a finite number of steps.

Page 5: Chap6

Algorithm

• The Term Algorithm refers to the logic of a program. It is a step-by-step description of a solution to the given problem.

• When sequence of instructions are executed in the specified format and sequence the desired result are obtained.

• Definition:- A format or set of steps for solving a particular problem is called as algorithm.

• It has clear starting and stopping point. With specific step by step instructions in each line.

Page 6: Chap6

Characteristics of Algorithm

• Each instruction should be precise and clear.• Each instruction should be executed in a finite

time.• One or more instructions should not be

repeated Infinitely.• After executing the instructions the desired

result are obtained.• It range from Simple to the Complex.

Page 7: Chap6

Process of algorithm

• An algorithm must express the steps in the solution in a way that will be suitable for computer processing.

• It Read Value perform a simple procedure and output the required result.

• After algorithm a Flowchart is prepared and than it is run in the language form in the computer.

Page 8: Chap6

Algorithm: The algorithm is part of the blueprint or plan for the

computer program, an algorithm is: “An effective procedure for solving a class of problems in a

finite number of steps.”

Every algorithm should have the following 5 characteristic feature:

1. Input2. Output3. Definiteness4. Effectiveness5. Termination

Page 9: Chap6

Algorithm• To find largest of three numbers1) Start2) Read 3 numbers: num1, num2, num33) if num1 > num2 then go to step 54) if num2 > num3 then

print num2 is largest else

print num3 is largest goto step 65) if num1 > num3 then

print num1 is largest else

print num3 is largest6) end.

Page 10: Chap6

Flowchart• A Flowchart is a pictorial representation of an

algorithm.• It is a symbolic diagram of operation

sequence, dataflow, control flow and processing logic in information processing.

• The symbol used are simple and easy to learn.• It is a very help full tool for programmers and

beginners.

Page 11: Chap6

Purpose of flowchart

• Provide Communication.• Provide an overview.• Show all elements and its relationship.• Quick method of showing program flow.• Check program logic.• Facilitate coding.• Provide program revision.• Provide Program documentation.

Page 12: Chap6

Advantages of flowchart.

• Communication.• Effective analysis.• Proper documentation.• Efficient coding.• Proper debugging.• Efficient program maintenance.• Easy and clear presentation.

Page 13: Chap6

Limitation of flowchart

• Complex logic.• Drawing is time consuming.• Alteration and modification.• Redrawn many times.• Difficult to draw and remember.• Reproduction ( replica ).• Technical detail.

Page 14: Chap6

Symbols used in flowchart

• All symbols are of different shape and size.• All have specific meaning and use.

Page 15: Chap6

BASIC SYMBOLSTerminal Symbol = for start and stop.

INPUT and OUTPUT = Any function of input and output data.

Processing = An arithmetic and data movement instruction. Shows mathematical calculation and logic operations.

Page 16: Chap6

SYMBOLSDecision = Diamond indicate decision point in the program flow. IT may have 2 way branch or 3 way also.

Flow Lines = A Straight line between two boxes shows the path of logic flow in the program. An arrow head on the top of the line shows the direction of the flow, data from top to bottom and left to right.

Connectors = 2 small circles are used to connect separated portions of a flowchart without drawing lines between the parts. One connector indicated where the flow breaks off the other where it resumes.

Page 17: Chap6

Flowchart for finding the sum of first five natural numbers ( i.e. 1,2,3,4,5):

Page 18: Chap6

Flowchart (Example):Flowchart to find the sum of first 50 natural numbers.

Page 19: Chap6

Start

Read A, B

Is A > B

Print A Print B

End

Yes No

Flow Chart to find largest of two numbers:

Page 20: Chap6

Flowchart to find the largest of three numbers A,B, and C:

NO

Page 21: Chap6

LIMITATIONS OF USING FLOWCHARTS:

• Complex logic: Sometimes, the program logic is quite complicated. In that case, flowchart becomes complex and clumsy.

• Alterations and Modifications: If alterations are required the flowchart may require re-drawing completely.

• Reproduction: As the flowchart symbols cannot be typed, reproduction of flowchart becomes a problem.