0% found this document useful (0 votes)
7 views9 pages

Chapter 2 SDLC

The document outlines the Software Development Life Cycle (SDLC), detailing the steps involved in problem-solving using computers, including problem analysis, algorithm development, flowcharting, coding, compilation, debugging, and documentation. Each step is explained with definitions and examples, emphasizing the importance of understanding the problem, creating algorithms, and documenting the program for future reference. Flowcharts are also introduced as a visual representation of algorithms, highlighting their advantages in communication and analysis.

Uploaded by

bipinpata2055
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)
7 views9 pages

Chapter 2 SDLC

The document outlines the Software Development Life Cycle (SDLC), detailing the steps involved in problem-solving using computers, including problem analysis, algorithm development, flowcharting, coding, compilation, debugging, and documentation. Each step is explained with definitions and examples, emphasizing the importance of understanding the problem, creating algorithms, and documenting the program for future reference. Flowcharts are also introduced as a visual representation of algorithms, highlighting their advantages in communication and analysis.

Uploaded by

bipinpata2055
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/ 9

Prepared By: ER.

Kamal Gyawali

Chapter 2: SDLC (software development life cycle)/problem solving using


computer: [2013 fall 7(b), 2018 spring 7(c)]

Software development life cycle contains following steps they are as follows:

1) Problem analysis
2) Algorithm development
3) Flowcharting
4) Coding
5) Compilation and execution
6) Debugging and testing
7) Program Documentation

Problem analysis

Algorithm Development

Flowcharting

Coding

Compilation and execution

Debugging and testing

Documentation
Prepared By: ER. Kamal Gyawali

1) Problem analysis:
Before solving a problem, it should be analyzed and understood well. It is impossible to solve a
problem by using computer without clear understanding and identification of the program.
The program’s inputs, outputs, different ways of solving problems, software requirement and
hardware requirements, time period of program should be known in advance well.

2) Algorithm development:
 An algorithm is step by step procedure to solve a problem.
Some convention used in developing algorithms
 Each algorithm will be enclosed by two statements START and STOP
 To accept data from user, the INPUT or READ statement is used.
 To display any user message, the PRINT or DISPLAY statement is used.
 The arithmetic operators (+, -, * and /) are used in the expressions.
 The relational operators (>, <, >=, <=, ==, != ) are used in conditions.
 The logical operators (AND, OR, NOT) are used for logical expressions.

3) Flowcharting:
 The pictorial/diagrammatic/graphical representation of an algorithm is known as
flowchart.

Flowchart symbols:
symbol Name

Flow line
Terminal(start/end)

processing

Input/output

Decision

Connector
Prepared By: ER. Kamal Gyawali

Advantages of flowchart:
 Communication
 Effective Analysis
 Proper documentation
 Efficient coding
 Easy in debugging and program maintenance

Examples:
1) Write an algorithm and draw flowchart for finding sum of any two numbers.
Algorithm:
1. Start
2. Print “Enter two numbers”.
3. Read A and B
4. Calculate sum S=A+B
5. Print “Sum of two numbers is S”.
6. Stop.
Flowchart:
Start

Print “Enter two


numbers “

Read A and B

Calculate sum
S=A+B

Print “sum of two


numbers is S”

Stop

2) Write an algorithm and draw flowchart for calculating simple interest.


Prepared By: ER. Kamal Gyawali

Algorithm:
1. Start
2. Print “Enter the value of principle, time and rate”
3. Read P, T and R
4. Calculate simple interest Si = (P*T*R)/100
5. Print “ Simple interest is Si”
6. Stop.

Flowchart:

Start

Print “Enter the value of


principle, time and rate”

Read P,T and R

Calculate simple interest


Si=(P*T*R)/100

Print “Simple
interest is Si”

Stop
Prepared By: ER. Kamal Gyawali

3. Write an algorithm and draw flowchart to check a given number is negative or positive.

Algorithm:

1. Start
2. Print “Enter a number”
3. Read n
4. If(n>0) then
print “Number is positive”
Else
print “Number is negative”
5. Stop. Start

Print “Enter a
number”

Read n

Is
True False
n>0

Print "number
Print "number
is positive"
is negative"

Stop
Prepared By: ER. Kamal Gyawali

4. Write an algorithm and draw flowchart to check given number is even or odd.

Algorithm:
1. Start
2. Print “Enter a number”
3. Read n
4. If(n%2==0) then
Print “Number is even”
Else
Print “Number is odd”
5. Stop.

Start

Print “Enter a
number”

Read n

True Is False
N%2==0

Print “Number is Print “Number is


even” odd”

End
Prepared By: ER. Kamal Gyawali

6. Write an algorithm and draw a flowchart to find the largest number among three numbers.

Algorithm:
1. Start
2. Print “Enter three numbers”
3. Read A, B, C
4. If(A>B)then
if(A>C) then
Print “A is largest number”
Else
Print “C is largest number”
Else
If (B>c) then
Print “B is largest number”
Else
Print “C is largest number”
5. Stop

Flowchart:
Prepared By: ER. KamalStart
Gyawali

Print “Enter three


numbers”

Read A, B, C

False Is True

A>B ?

True False False True


is
is
(B>C)
(A>C)
? ?

Print “B is Print “C is
Print “A is
largest” largest
number” largest”

End
Prepared By: ER. Kamal Gyawali

For further algorithm and flowchart we will discuss in chapter 4 control statements

4) Coding:
 The process of transforming the program logic design into computer language format.
 C, c++, java etc. are the example of programming language which is used for coding.

5) Compilation and execution:


 The process of changing high level language into machine level language is known as
compilation.
 It is done by special software known as compiler.
 The compilation process tests the program whether it contains syntax error or not. If
syntax errors are present, compiler cannot compile the code.
 Once the compilation is completed then the program is linked with other object
programs needed for execution, finally it is executed.
 During the execution, the program may ask user for inputs and generates outputs after
processing the inputs.

6) Debugging and testing:


 Debugging is the discovery and correction of programming errors.
 Testing ensures that program performs correctly the required task.

7) Program documentation:
 Program documentation is description of the program and its logic written to support
understanding the program.
 Documentation of program helps to those who use, maintain and extend the program in
future.
 Properly documented program is necessary which will be useful and efficient in
debugging, testing, maintenance and redesign process.

You might also like