1 / 30

C HAPTER 11

C HAPTER 11. Computer Programming. Movie Trivia. In what movie did Peter Gibbons file his TPS report with fish guts? Quality Assurance Test Procedure Specification Test Program Set. Computer Programming and Software Engineering.

Télécharger la présentation

C HAPTER 11

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 11 Computer Programming

  2. Movie Trivia • In what movie did Peter Gibbons file his TPS report with fish guts? • Quality Assurance • Test Procedure Specification • Test Program Set Chapter 11: Computer Programming

  3. Computer Programming and Software Engineering • The instructions that make up a computer program are sometimes referred to as code • Programs can have several hundred to 50 million of lines of code Chapter 11: Computer Programming

  4. Programming Languages • Programming languages are made up of keywords and grammar rules designed for creating computer instructions • Low-level languages typically include commands specific to a particular CPU or microprocessor family • High-level languages use command words and grammar based on human languages Chapter 11: Computer Programming

  5. Programming Languages • First-generation languages • Machine language • Second-generation languages • Assembly language • Third-generation languages • Easy-to-remember command words Chapter 11: Computer Programming

  6. Programming Languages • Fourth-generation languages • More closely resembles human language • Fifth-generation languages • Visual GUI Chapter 11: Computer Programming

  7. Programming Languages and Paradigms Chapter 11: Computer Programming

  8. Program Planning • The problem statement defines certain elements that must be manipulated to achieve a result or goal • You accept assumptions as true to proceed with program planning • Known information helps the computer to solve a problem • Variables vs. constants Chapter 11: Computer Programming

  9. Program Coding Chapter 11: Computer Programming

  10. Program Coding • A program editor is a type of text editor specially designed for entering code for computer programs Chapter 11: Computer Programming

  11. Program Coding • A VDE (visual development environment) provides programmers with tools to build substantial sections of a program • Form design grid • Control • Properties • Event • Event-handling code Chapter 11: Computer Programming

  12. Program Coding Chapter 11: Computer Programming

  13. Program Testing and Documentation • A computer program must be tested to ensure that it works correctly • Program errors include • Syntax errors- grammar • Runtime errors- can’t execute • Logic errors- wrong formula or calculation • A debugger can help a programmer read through lines of code and solve problems Chapter 11: Computer Programming

  14. Program Testing and Documentation • Remarks or “comments” are a form of documentation that programmers insert into the program code Chapter 11: Computer Programming

  15. Algorithms • Set of steps for carrying out a task that can be written down and implemented • Start by recording the steps you take to solve the problem manually • Research and gather information • Specify how to manipulate information • Specify what the algorithm should display as a solution Chapter 11: Computer Programming

  16. Expressing an Algorithm • Structured English • Concise English • Pseudocode • Concise English • Algorithm notation Chapter 11: Computer Programming

  17. Expressing an Algorithm • Flowchart • Page 621 Chapter 11: Computer Programming

  18. Expressing an Algorithm • Perform a walkthrough to make sure your algorithm works • Test the code • Use sample data Chapter 11: Computer Programming

  19. Sequence, Selection, and Repetition Controls • Sequence control structure- changes order Normally the program will run in sequential order; 1st, 2nd,3rd,4th,5th Executing a GOTO command directs the computer to a different part of the program. Chapter 11: Computer Programming

  20. Sequence, Selection, and Repetition Controls • Subroutines, procedures, and functions are sections of code that are part of the program, but not included in the main execution path Chapter 11: Computer Programming

  21. Sequence, Selection, and Repetition Controls • Selection control structure The computer executes a decision indicated on the flowchart by the question in the diamond shape. Chapter 11: Computer Programming

  22. Sequence, Selection, and Repetition Controls • Repetition control structure To execute a loop, the computer repeats one or more commands until some condition indicates that the looping should stop. Chapter 11: Computer Programming

  23. Procedural Languages • Popular procedural languages include FORTRAN, COBOL, Pascal, C, and BASIC • The procedural approach is best used for problems that can be solved by following a step-by-step algorithm • Calculation efficiency • Produces programs that run quickly and efficiently • Missile guidance • Variables – wind speed, distance, wind direction, target speed, target heading, launch heading • Constants – fuel, weight, gravity • Cash registers Chapter 11: Computer Programming

  24. Object-Oriented Programming • An object represents an abstract or real-world entity • A class is a template for a group of objects with similar characteristics • A class attribute defines the characteristics of a set of objects Chapter 11: Computer Programming

  25. Chapter 11: Computer Programming

  26. Object-Oriented Languages • SIMULA was believed to be the first object-oriented computer language • Popular object-oriented languages today are C, C++, Visual Basic, and C# Chapter 11: Computer Programming

  27. The Declarative Paradigm • Attempts to describe a problem without specifying exactly how to arrive at a solution • A fact is a statement for solving a problem • Rules describe the relationship between facts • Used for processing words and language Chapter 11: Computer Programming

  28. The Declarative Paradigm • A decision table is a tabular method for visualizing and specifying rules based on multiple factors • Price, Delivery, Speed Chapter 11: Computer Programming

  29. Declarative Languages • Declarative programming languages are most suitable for problems that pertain to words and concepts rather than to numbers • High effective programming environment • Not commonly used for production applications • Minimal input and output capabilities • Poor performance on today’s personal computer architecture Chapter 11: Computer Programming

  30. Lab Assignment • Create two flowcharts using MS Word • Create a “help” algorithm solution flowchart for a printer not working • Create a algorithm flowchart that continuously monitors battery power and will trigger an alarm when the battery is in use and will then shut down the computer if the battery is low on power. • Page 621 has an symbol key Chapter 11: Computer Programming

More Related