1 / 16

Chapter 1 (Cont..) Programming Lifecycle

Chapter 1 (Cont..) Programming Lifecycle. OBJECTIVES.  Introduce the general step programmers go through to develop computer programs and software  Explain the phases in the system development life cycle. Programming Life Cycle. D o c ume n t a t I o n. Problem Analysis.

lbrothers
Download Presentation

Chapter 1 (Cont..) Programming Lifecycle

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 1 (Cont..) Programming Lifecycle CSC425 - Introduction To Computer Programming

  2. OBJECTIVES  Introduce the general step programmers go through to develop computer programs and software  Explain the phases in the system development life cycle. CSC425 - Introduction To Computer Programming

  3. Programming Life Cycle D o c ume n t a t I o n Problem Analysis Programs Modelling Coding Programs Testing and Debugging Maintenance CSC425 - Introduction To Computer Programming

  4. Step 1 : Problem Analysis •  Defining the problem •  Identify : • 1. Input (given data) • 2. Output (the result) • 3. Process • - relation between input and output • - using formula Input Process Output CSC425 - Introduction To Computer Programming

  5. Example Problem 1 Write a program that can input 3 integer number from user. Find the average for the number. Display all the numbers and the average Problem analysis Input : 3 numbers Process : 1. total up 3 numbers 2. Divide the number by 3 Output : 3 numbers and the average CSC425 - Introduction To Computer Programming

  6. 1. Set sum = 0, avg = 0 2. Read 3 integer number 3. Total up 3 integer number sum = a+b+c 4. Find the average avg = sum / 3 5. Display 3 integer number and average algorithm Step 2 : Programs Modeling •  Planning the solution to a problem •  Using algorithm, flowchart or pseudocode [Refer Problem 1] CSC425 - Introduction To Computer Programming

  7. start sum =0 , avg = 0 Read a, b, c sum = a+b+c avg = sum / 3 Display a,b,c Display avg End [Refer Problem 1] START INPUT a,b,c sum = a+b+c avg = sum / 3 PRINT a,b,c PRINT avg END Pseudocode Flowchart CSC425 - Introduction To Computer Programming

  8. Step 3 : Coding and programs source code •  Express solution in a programming language •  Translate the logic from the flowchart or pseudocode. •  There are many programming languages : BASIC, COBOL, Pascal, Fortran, C, C++, Java etc •  Each language has it’s own syntax (rules of language) CSC425 - Introduction To Computer Programming

  9. Output of the program [Refer problem 1] Coding in C++ Language CSC425 - Introduction To Computer Programming

  10. Step 4 : Testing and Debugging •  Trace error either syntax or logic error • Testing •  running the program with a set of data • Debugging •  Trace and fixed the error CSC425 - Introduction To Computer Programming

  11. Run-time error • Occur during program execution • Detected by compiler • Occur because of logic error or memory leak • Syntax error • Error in the structure or spelling of a statement • Detected by the compiler during compilation of the program • Example: • Missing semicolon, quote CSC425 - Introduction To Computer Programming

  12. Logic error • Unexpected/unintentional errors resulted from flaw in the program’s logic • Produce undesired result/output • Cannot be detected by compiler • Compare the result with manual process CSC425 - Introduction To Computer Programming

  13. Documentation •  An ongoing process •  Written detailed description of the program cycle and specific facts about the program •  Documentation materials include : • 1. Description of the program • 2. Logic tools : flowcharts, pseudocode • 3. Data- record descriptions • 4. Program listing • 5. Testing results • 6. Comments CSC425 - Introduction To Computer Programming

  14. Why programmers put comment? • To explain/describe the program/function/statement • To help other programmers understand the program/function/statement • 2 types of comments • Line comment: single line comment • Block comment: multiple line comment • Syntax comment is differ to certain languages CSC425 - Introduction To Computer Programming

  15. Step 5 : Maintenance •  Modification made to the finished program •  Software to meet current requirement •  Need to refer the previous documentation CSC425 - Introduction To Computer Programming

  16. Accuracy Reliability A good program must have • Efficiency Maintainability Readability Usability CSC425 - Introduction To Computer Programming

More Related