Software Life Cycle - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Software Life Cycle

Description:

Title: PowerPoint Presentation Last modified by: prakash.kumar Created Date: 7/25/2005 7:48:37 AM Document presentation format: On-screen Show (4:3) – PowerPoint PPT presentation

Number of Views:78
Avg rating:3.0/5.0
Slides: 22
Provided by: yola362
Category:

less

Transcript and Presenter's Notes

Title: Software Life Cycle


1
Software Life Cycle
Requirements Gathering, Problem definition
Analysis and Design (Programming techniques)
Coding
Testing
Implementation and Maintenance
2
Coding and Testing
3
How to develop a program
  • Identify the steps and execution sequence.
  • Every program consist of mainly three parts
  • Input, Processing and Output
  • Example Add two numbers
  • Steps
  • Read/Input two numbers
  • Add these two numbers
  • Display/Output the result of addition
  • Algorithm Steps written in English language.
  • Program Algorithm written in a specific high
    level language.

4
Algorithm
  • An Algorithm is a solution to a problem that is
    independent of any programming language.
  • An Algorithm is
  • a finite sequence of steps
  • each step shall be clearly stated and
    understandable
  • for each input, it shall terminate in finite time
    with output
  • How we solve the problem with Computer?

5
Program and Programming
  • Program
  • A set of instruction written in a programming
    language that a computer can execute so that the
    machine acts in a predetermined way.
  • Program solves a problem
  • Before writing a program
  • Have a thorough understanding of the problem
  • Carefully plan an approach for solving it.
  • Programming
  • The Process of providing instructions to the
    computer that tells the processor what to do.

6
Algorithms Programs
  • An Algorithm is a solution to a problem that is
    independent of any programming language. Wh
    ile
  • A program is an algorithm expressed using a
    specific set of instructions from any programming
    language.

7
Algorithm Example
  • Maximum of two numbers
  • Steps
  • Read/input two numbers
  • Compare two numbers
  • Print the Greater number
  • Average of three numbers
  • Steps
  • Read/input three numbers
  • Add three numbers
  • divide the sum by 3.
  • Print the result of divison

8
Pseudocode
  • This is a common notation for writing algorithms.
  • Mixture of English language statement and a
    programming language( like C) code.
  • It is an intermediate step in writing a program.
  • Not actually executed on computers.
  • Standard mathematical notations like
    exponents,square-root symbols etc. are allowed in
    pseudocode.

9
Rules for pseudo code
  • The beginning and end of a pseudo code is marked
    with keywords START and STOP.
  • Every variable should be initialized in the
    beginning only using INITAILZE
  • Values from user should be accepted using keyword
    READ, and should be display using WRITE.
  • All alphanumeric values should be enclosed in
    single or double quotes.
  • All the nested loops are for-do-done,
    while-do-done
  • All the control structures are if-then-else-fi,
    switch-case.

10
Examples
  • Pseudo code to find out the sum of all
  • odd numbers in the range 1 to 10.
  • START
  • INITIALIZE a10, sum0,i
  • for i1 to 10 do
  • Read ai
  • if (condition) then
  • Calculate sumsumai
  • done
  • Write sum
  • STOP

11
Examples
  • Pseudo code to find out the maximum number from
    20
  • given numbers.
  • START
  • INITIALIZE a20,max,i
  • for i1 to 20 do
  • Read ai
  • done
  • maxa1
  • for i2 to 20 do
  • if aigtmax then
  • Assign maxai
  • done
  • Write max
  • STOP

12
Practice Example
  • Write an algorithm for the given problem
  • 10 students of a class appears for a test in
    three
  • subjects. Each test is out of 100 marks. The
    percentage
  • of each student has to be calculated and
    depending on
  • the percentage calculated, grades are given below

Percentage Grade
gt 80 A
60-79 B
lt59 C
13
Flowchart
  • Graphical representation of an algorithm
  • Components
  • Arrows/lines Flow of control
  • Parallelogram Indicates input and output
    operations
  • Rectangle symbol (action symbol) Indicates any
    type of action/computational step
  • Oval symbolIndicates the beginning or end of a
    program or a section of code
  • Diamond Decision

14
Flowchart Notations
Arrows
Diamond
Parallelogram
Oval
Rectangle
15
(No Transcript)
16
Example Add two Numbers
17
Draw both flow chart and pseudo code
  • You are required to calculate area of circle and
    rectangle.
  • Accept from user the figure and then accordingly
    calculate and display.

18
Pseudo code
  • START
  • INITIALIZE FIG, area0
  • READ FIG
  • IF FIG circle
  • CALL CIR_ROUTINE
  • ELSE
  • IF FIGrectangle
  • CALL RECT_ROUTINE
  • ELSE
  • GOTO label 1
  • ENDIF
  • ENDIF
  • WRITE area of figure, area
  • STOP

label 1
19
  • CIR_ROUTINE
  • INITIALIZE radius0
  • READ radius
  • CALCULATE area 3.14 radius radius
  • RETURN to Calling procedure

RECT_ROUTINE INITIALIZE length0, width0
READ length,width CALCULATE area
lengthwidth RETURN to Calling procedure
20
Flow Chart
READ FIG
START
FIG?
READ LENGTH WIDTH
rectangle
other
circle
READ RADIUS
AREALENGTH WIDTH
PRINT AREA
AREA3.14RADIUS RADIUS
STOP
21
Problems
  • GCD of three numbers
  • Calculate 2n
  • Roots of equation ax2bxc0
  • Largest of N numbers
  • Generate the fibonacci series
Write a Comment
User Comments (0)
About PowerShow.com