3 Program Development Life Cycle.aaaaapptx

EG20910848921ISAACDU 11 views 41 slides Oct 09, 2024
Slide 1
Slide 1 of 41
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41

About This Presentation

Revision


Slide Content

Program Development Life Cycle

Stages in Program development cycle Problem recognition Problem definition. Program design. Program coding. Program testing. Program Implementation and maintenance. Program documentation

Problem recognition Problem recognition refers to the understanding and interpretation of a particular problem. The programmer must know what problem he/she is trying to solve. He/she must also understand clearly the nature of the problem & the function of the program.

Situations that cause problem identification Problems or undesirable situations that prevent an individual or organizations from achieving their purpose. Opportunity to improve the current program. A new directive given by the management requiring a change in the current sys

Example of problems Program to calculate area of a triangle. Program to enter student name, maths , english and kiswahili then calculate total marks and average marks.

2. Problem definition Also known as problem analysis. In defining a problem the programmer tries to identify: - Input(s) - Process(s) - File(s) (Storage) - Output(s)

3. Program design Program design enables the programmer to come up with a model of the program in sequence of simple steps also known as algorithm . The algorithm show the systematic flow of events throughout the entire program from input to output.

Algorithm An Algorithm is a limited number of logical steps that a program follows in order to solve a problem Algorithms take little or no account of the programming language. They must be precise/ accurate, unambiguous/clear and should guarantee a solution Algorithm is illustrated using: - P seudocode - Flowchart

Pseudocode A pseudocode is a method of documenting a program logic in English-like statements to describe the processing steps. Guidelines for designing a good pseudocode. A pseudocode must have a Begin and end. The input, output and processing statements should be clearly stated using keywords such as Output: PRINT , OUTPUT, DISPLAY and Input: READ , INPUT, SCAN etc .

Pseudocode of a program to calculate area of a triangle Begin INPUT base INPUT height Area= 0.5 * base * height OUTPUT area End.

Pseudocode of a program to calculate area of a rectangle Begin Input length Input width Area = length * width Print area End

Pseudocode of a program to input 3 subject marks then calculates and displays total and average marks

Pseudocode of a program to input subject marks then calculates and displays total and average marks Begin INPUT maths INPUT english INPUT kiswahili Total = maths+english+kiswahili Average=total/3 OUTPUT total OUTPUT average End.

F = + 32   Begin Input C F = ( + 32 Output F stop  

Area of a circle Begin Read radius Set pi=3.14 Area=pi * radius * radius Circumference = 2 * pi * radius Print area Print circumference End Begin Read radius Area= 3.14* radius * radius Circumference = 2 * 3.14 * radius Print area Print circumference End

Example Write a pseudocode of a program to solve the equation of a straight line given by the expression: Y = mx + c . BEGIN INPUT m INPUT x INPUT c y=(m*x) + c OUTPUT y END.

Write a pseudocode for a program that prompts the user to enter their age . If the age entered is below 18, it should display “you’re a young person”, otherwise it should display “you’re an adult”

Begin Read age If age < 18 Output “you are a young person” Else Output “you are an adult” Stop

Flowchart A Flowchart is a diagrammatic or pictorial representation of a program’s algorithm. It is a chart that demonstrates the logical sequence of events that must be performed to solve a problem.

Flowchart symbols A Flowchart is constructed using a set of special shapes (or symbols) that have specific meaning. Each symbol contains information (short text) that describes what must be done at that point. The symbols are joined by arrows to obtain a complete Flowchart. The arrows show the order in which the instruction must be executed.

Symbol Meaning Start/End - Indicate the start and end of a flowchart Input / Output symbol Process symbol Decision symbol Flow Connector

Flowchart of a program to solve the equation of a straight line given by the expression: Y = mx + c. START Input m, x and c Y=(m*x) + c Output Y STOP

Circumference and area of a circle Start Input radius Area = 3.14 * radius * radius Circumference = 3.14 * 2* radius Output area, circumference Stop Start Input radius Area = pi* radius * radius Circumference =pi* 2* radius Output area, circumference Stop Set pi = 3.14

F = + 32   Start Input C F = (9/5)*C+ 32 Output F Stop

Begin Input age If age<18 then Output “you are a young person” Else Output “You are an adult” End START Input age Output “You are a young person” STOP If age < 18 Output “You are a an adult” Yes No

Hint BMI= weight/Height 2 BMI Remarks Below 18 You are underweight Between 18 and 25 Your weight is normal Between 25 and 30 You are overweight Above 30 You are obese

Pseudocode Begin Input weight Input height BMI = weight/(height*height) If BMI <18 Output “You are underweight” Else if BMI >=18 and BMI <= 25 Output “you are normal” Else if BMI > 25 and BMI <=30 Output “you are overweight” Else Output “you are obese End

Begin Input weight, height BMI = weight/(height*height) BMI < 18 BMI >=18 and BMI<=25 BMI < 25 and BMI<=30 Output “underweight” Yes No Output “ normalt ” Output “overweight” Output “obese” Yes No Yes No End

Program coding Program coding is the actual process of converting a design model into its equivalent program. Coding requires the programmer to convert the design specification (algorithm) into actual computer instructions using a particular programming language.

Example Develop a program code that will be used to solve the equation of a straight line given by the expression: Y = mx + c.

Example (PASCAL) Program StraighLine (input, output); VAR y, m, x, c: INTEGER ; BEGIN Writeln (‘Input the value of M’); Readln (m); Writeln (‘Input the value of X’); Readln (x); Writeln (‘Input the value of C’); Readln (c); Y : = (m * x) +c; Writeln (‘The value of y is:’, Y); END .

Program trianglearea (input, output); VAR b,h : INTEGER; area:REAL ; BEGIN Writeln (‘Input the value of Base’); Readln (b); Writeln (‘Input the value of Height’); Readln (h); area: = 0.5 * b * h; Writeln (‘The value of area is:’, area); END.

Program Testing and Debugging After designing & coding, the program has to be tested to verify that it is correct, and any errors detected removed (debugged). Testing is the process of running computer software to detect/find any errors (or bugs ). Most programming errors often remain undetected until an attempt is made to translate a program. The term Bug is used to refer to an error in a computer program Debugging is therefore, the process of detecting, locating & correcting (removing, eliminating) all errors (mistakes or bugs) that may exist in a computer program

Types of program errors Syntax errors. Run-time (Execution) errors. Logical errors. Semantic errors Lexicon errors

Syntax errors Every programming language has a well-defined set of rules concerning formal spellings, punctuations, naming of variables, etc. Syntax errors are therefore, programming errors/mistakes that occur if the grammatical rules of a particular language are not used correctly.

Run-time (Execution) errors These errors occur during program execution. Run-time (execution) errors occur when the programmer introduces new features in the program, which are not part of the translator’s standards. For example if the computer is asked to divide a number by zero.

Logical error Logical errors relate to the logic of processing followed in the program to get the desired results. E.g. they may occur as a result of misuse of logical operators. Logical errors cannot be detected by the translator. The program will run, but give the wrong output

Semantic errors They occur when the programmer develops statements, which are not projecting towards the desired goal. Such statements will create deviations from the desired objectives. Semantic errors are not detected by the computer.

Lexicon errors These are the errors, which occur as a result of misusing Reserved words (words reserved for a particular language).

Program implementation Implementation refers to the actual delivery, installation and putting of the new program into use. The program is put into use after it is fully tested, well documented, and after training the staff who will be involved in the running of the new program.

Program documentation After writing, testing, and debugging a program, it must be documented. In other words, the programmer should describe all what he was doing during the program development stages. Program documentation is the writing of supportive materials explaining how the program can be used by users (user manual), installed by operators, or modified by other programmers (Technical manual).
Tags