1 / 94

Program

Learn about Noornilo Nafees' program development cycle methodologies and problem solving steps that include analysis, solution identification, algorithm preparation, program creation, execution, and maintenance.

jalexandre
Download Presentation

Program

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. Program • Program is a collection of instructions that will perform some task. Noornilo Nafees

  2. Problem Solving Steps • Analyse the problem. • Identify the solution for the problem and divide it into small task. • Algorithm has to be prepared. • Based on the algorithm the program will be created. • Then it has to be executed. Noornilo Nafees

  3. Program Development Cycle Methodologies • Program planning method • Waterfall method etc,. Noornilo Nafees

  4. Program planning method Specification Review Informal Design Formal Design Coding Test & Debug Maintaining Noornilo Nafees

  5. Specification review • collect the requirements • understand the requirements • Informal Design • Identifies the major tasks • Identifies the subtasks • Formal Design • It converts the informal design to some format that can be understand by others. Noornilo Nafees

  6. Coding • It converts the Design into Programs. • It translate these programs to machine language. • Test &Debug • It use sample data to test whether it works properly. • It also eliminate the errors. Noornilo Nafees

  7. Maintaining • It Modifies the programs if necessary. Noornilo Nafees

  8. Waterfall method Feasibility Analysis Design Impl Testing Maintenance Noornilo Nafees

  9. Feasibility • It determines whether it is possible to create the project or not. • It also produce the plans and the estimates. • Analysis • It get the requirements from the customer. • It analysis the requirements. Noornilo Nafees

  10. Design • It is the process of designing how the requirements to be implemented. • Implementation • It converts the designs into code. • After coding it use language translators to compile the code. Noornilo Nafees

  11. Testing • Here the modules are integrated together. • Then the project is tested and find whether it meets the customer/user requirements. • Maintenance • It make modifications based on the customer feedbacks. Noornilo Nafees

  12. Algorithm • An algorithm is a well organized, pre arranged and defined textual computational module that receives some values or set of values as IP & provides a single or a set of values as OP. • It helps the programmer in breaking down the solution of a problem into a number of sequential steps. Noornilo Nafees

  13. Characteristics • The steps in the algorithm must be unambiguous . • It should be written in sequence. • Ensure that the algorithm will terminate. • It should conclude after a finite number of steps. Noornilo Nafees

  14. Factors used to judge the algorithm • Time • Memory • Accuracy • Sequence etc,. Noornilo Nafees

  15. Example • Addition of two numbers Step1: Start Step2: Read a, b Step3: Add the value of a with b andstore the result in c. Step4: Display the value of c Step5: Stop Noornilo Nafees

  16. Pseudocode • Pseudo means imitates andcode means instruction. • It is formal design tool. • It is also called Program Design Language. Noornilo Nafees

  17. Keywords • READ,GET • PRINT,DISPLAY • COMPUTE,CALCULATE Noornilo Nafees

  18. Guideline for writing Pseudocode • Steps should be understandable • Capitalize the keyword. • Indent to show hierarchy. • End multiple line structure etc,. Noornilo Nafees

  19. Example READ a,b C=a+b WRITE C stop Noornilo Nafees

  20. Example READ a,b IF a>b PRINT a is greater ELSE PRINT b is greater ENDIF stop Noornilo Nafees

  21. Advantage & Disadvantage • It can be easily modified • It can be understood easily • Compare to flowchart it is difficult to understand the program logic. Noornilo Nafees

  22. Flowcharts • It is the pictorial representation of the process. • It describes the sequence & flow of control & information in a process • It uses different symbols for depicting different activities Noornilo Nafees

  23. Flowchart Symbols • Terminal symbol • It is used to represent the start, end of the program logic. • Input/Output • It is used for input or output. • Process Symbol • It is used to represent the calculations, data movements, initialization operations etc,. Noornilo Nafees

  24. Decision Symbol • It is used to denote a decision to be made at that point • Flow lines • It is used to connect the symbols • Connectors • It is used to connect the flow lines. • Loop • It is used to denote loops involved in the process. Noornilo Nafees

  25. Guidelines for preparing flowcharts • It should be clear and easy to follow • Standard symbols should be used. • The flow lines should not intersect each others. • In case of complex flowcharts use the connectors symbols. • Direction of flow of procedure is from left to right or top to bottom • It must have one logical start and end. Noornilo Nafees

  26. Only one flow line should enter the process symbol and only one flow line should come out from a process symbol. • Only one flow line used with the terminal symbol. START STOP Noornilo Nafees

  27. Only one flow line should enter the decision symbol and two or three flowlines may leave from the decision symbol. Noornilo Nafees

  28. Benefits of Flowcharts • Makes Logic Clear • Communication • Effective Analysis • Proper Documentation • Efficient Coding • Proper Debugging • Efficient Program Maintenance Noornilo Nafees

  29. Limits of Flowcharts • It is difficult to use flowcharts for large program • Difficult to modify • Cost etc,. Noornilo Nafees

  30. Design Structures Sequence control structure Flow chart Pseudocode Process 1 Process 2 Process n Process 1 Process 2 Process n Noornilo Nafees

  31. Sequence control structure The instructions are computed in sequence i.e. it performs instruction one after another. It uses top-down approach. Design Structures Noornilo Nafees

  32. Example START Read a,b C=a+b Print c STOP Noornilo Nafees

  33. SELECTION CONTROL STRUCTURE • It is used for making decisions. • It allows the program to make a choice from alternative paths. • IF …THEN • IF …THEN… ELSE • CASE etc., Noornilo Nafees

  34. IF…THEN Pseudocode Flow chart IF condition THEN process 1 . .END IF . . If condition YES Process 1 NO Noornilo Nafees

  35. Example Start Read a yes If a>0 no Print a is Positive Stop Noornilo Nafees

  36. IF…THEN…ELSE Pseudocode Flowchart IF condition THEN process 1 . . ELSE process 2 . .END IF . . If condition YES NO Process 1 Process 2 Noornilo Nafees

  37. Example Start Read a,b yes If a>b no Print a is Greater Print b is Greater Stop Noornilo Nafees

  38. CASE structure Pseudocode Flow chart . . CASE Type Case Type-1: Process 1 Case Type-2: Process 2 . . Case Type-n: Process n . . END CASE Type 1 yes Process 1 no yes Type 2 Process 2 no Type 3 Process 3 yes no Noornilo Nafees

  39. Example: Finding the Grade start Read m1,m2,m3 Avg=(m1+m2+m3)/3 If Avg>=60 Print First Class If Avg>=50 Print Second Class If Avg>=35 Print Third Class Fail Noornilo Nafees stop

  40. Looping control structure • It is used to execute some instructions several time based on some condition. • WHILE loop • Do…WHILE loop etc., Noornilo Nafees

  41. WHILE Loop Pseudocode Flow chart . . WHILE condition . . Body of the loop . . END WHILE condition no yes Body of The loop Noornilo Nafees

  42. Example Start Num=0 while Num<5 no yes Num=Num+1 Print Num stop Noornilo Nafees

  43. DO…WHILE Loop Pseudocode Flow chart DO . . Body of the loop . . WHILE condition . . END WHILE Body of The loop yes condition no Noornilo Nafees

  44. Example Start Num=0 Num=Num+1 while Num<5 yes no Print Num stop Noornilo Nafees

  45. Example: Finding the area of a circle Algorithm Step1: Start Step2: Read the value of r Step3: Calculate area Step4: Print area Step5: Stop Noornilo Nafees

  46. Pseudocode Set area READ the r COMPUTE area=3.14*r*r PRINT area stop Noornilo Nafees

  47. Flowchart START Read r area=3.14*r*r Print area STOP Noornilo Nafees

  48. Find the largest among three Numbers Algorithm Step1: Start Step2: Read the value of a, b, c Step3: IF (a>b) and (a>c) THEN print a is largest ELSE IF (b>c) THEN print b is largest ELSE print c is largest Step4: Stop Noornilo Nafees

  49. Pseudocode READ a, b, c IF (a>b) and (a>c) THEN WRITE a is largest ELSE IF (b>c) THEN WRITE b is largest ELSE WRITE c is largest ENDIF stop Noornilo Nafees

  50. Flowchart START Read a,b,c If (a>b) and (a>c) yes Print a Is largest no yes If b>c Print b Is largest no Print c Is largest Noornilo Nafees stop

More Related