Program Development Cycle-Programming-Lecture Slides, Slides of Computer Programming

This lecture was delivered by Prof. Varun Sahil to explain Programming concepts at Ankit Institute of Technology and Science. It includes: Analyze, Program, Development, Cycle, Design, Code, Debug, Test, Documentation, Flowchart

Typology: Slides

2011/2012

Uploaded on 07/23/2012

paravi
paravi 🇮🇳

5

(1)

65 documents

1 / 43

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
2
Program Development Cycle:
1. Analyze: Define the problem
2. Design: Plan the solution to the
problem. Do it on paper.
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b

Partial preview of the text

Download Program Development Cycle-Programming-Lecture Slides and more Slides Computer Programming in PDF only on Docsity!

2

Program Development Cycle:1. Analyze: Define the problem2. Design: Plan the solution to theproblem. Do it on paper.

3

Program

Development Cycle:

3. Code: Translate the algorithm into aprogramming language.4. Debug and Test: Locate and removeany errors in the program.5. Complete the Documentation: Organizeall the materials that describe theprogram. Document all stages ofdevelopment.

5

What is a flowchart?^ Logic diagram to describe each stepthat the program must perform toarrive at the solution.^ A popular logic tool used for showing analgorithm in graphics form.

6

Purpose of Flowcharting:^ An aid in developing the logic of aprogram.^ Verification that all possible conditionshave been considered in a program.^ Provides means of communication withothers about the program.^ A guide in coding the program.^ Documentation for the program.

8

FlowchartsDecision: Logic comparison operations.Have one entry and two exit points

Question?

Yes No

9

FlowchartsStart and Stop Points

11

FlowchartsFlow lines: Show the flow of controlthrough the flow chart between theprocesses and decision boxes.

12

Advantages andDisadvantages of Flowcharts^ For^ 

Easy to create  Easy to read Against  Very procedure oriented (i.e. Not ObjectOriented!)

14

‘for’ Loopfor(initialisation;

condition;update)

{ … statements to do;… }^

Is Conditiontrue?

No

Update Do theseinstructionsYes Initialisation

Init, update, conditionDo theseinstructions

15

‘do…while(

Condition)’ Loop

do { … statements to do;… } while(

condition);

Is Conditiontrue?

No Do theseinstructions

Yes

17

Summation Solution

Start Stop

i = i + 1 No

Yes sum=0i = 0 Is i <= N

sum=sum+i

InputN Outputsum

18

Factorial Exercise^ Write the flow diagram for the casewhere a positive number N is input, andthe factorial of N is calculated andoutput to the screen.Factorial of N = N! = N(N-1)(N-2)…1So Factorial of 5 = 5! = 54321 = 120.

20

Reverse Engineering^ Take C code and turn it into a flow chart. #include<stdio.h>int main(){ int i=0;while(i<10){ printf(“%d\n”,i);;i = i+1;} return (0);}

Start i = 0 Is i < 10 Stop

i = i + 1 Yes No Outputi

21

Reverse Engineering Exercise Take code C and turn it into a flow chart. #include<stdio.h>int main(){ int i,n,sum;printf("Enter a positive integer\n“);scanf(“%d”, &n);sum=0;for(i=0; i<(n+1); i++){ if(i%2==0) continue;sum =sum + i;} printf("The sum of %d first even integers = %d\n”, n, sum);return (0);}