Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computers Are Your Future Tenth Edition Chapter 11: Programming Languages & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as.

Similar presentations


Presentation on theme: "Computers Are Your Future Tenth Edition Chapter 11: Programming Languages & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as."— Presentation transcript:

1 Computers Are Your Future Tenth Edition Chapter 11: Programming Languages & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall1

2 2 All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. Copyright © 2009 Pearson Education, Inc. Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall

3 What You Will Learn Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall3 Explain what a programming language is. Contrast machine language and assembly language. Discuss the benefits and drawbacks of high-level programming languages. Explain how object-oriented languages attempt to remedy the shortcomings of earlier languages.

4 What You Will Learn List several popular object-oriented languages and explain their advantage over older languages. List the six phases of the program development life cycle (PDLC) and explain why the PDLC is needed. Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall4

5 What You Will Learn Explain why top-down program design makes programs easier to debug and maintain. List the three basic types of control structures and the advantages of each. Differentiate between syntax errors and logic errors in programs. Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall5

6 Programming Language & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall6

7 Development of Program Languages Programming is the creation of software applications. Programmers are the people who create the software applications. A programming language is a language used by programmers to create programs or software that the computer understands. Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall7

8 Development of Program Languages Syntax is the vocabulary and “grammar” of a programming language. Code is the programming instructions created by the programmers. Source code, the only form of code that humans can read, is program code in its original form. Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall8

9 Development of Program Languages Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall9

10 Development of Program Languages There are five distinct programming language generations, or levels: Machine language Assembly language Procedural languages Nonprocedural languages Natural languages Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall10

11 Development of Program Languages Machine language First-generation language Based on binary numbers The only programming language a computer understands directly Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall11

12 Development of Program Languages Assembly language A low-level, second-generation language Requires programming individual instructions for each task to be performed by the microprocessor Mnemonics Uses brief abbreviations for program instructions Makes language easier to use than machine language Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall12

13 Development of Program Languages Procedural languages Third-generation languages Considered high-level languages Do not require programmers to know details relating to the processing of data Easier to read, write, and maintain Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall13

14 Development of Program Languages Two utility programs that translate code so that the computer can interpret and run programs are: Compilers Translate source code into object code Interpreters Translate source code and execute instructions Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall14

15 Development of Program Languages Categories of Procedural Language Structured programming languages A solution to spaghetti code Lots of GOTO statements Difficult to follow and prone to errors A set of standards to make programs more readable, reliable, and maintainable Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall15

16 Development of Program Languages Categories of Procedural Language (continued) Modular programming languages Divide programs into self-contained modules Use information hiding: keeping information about one module secret from authors of other modules Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall16

17 Development of Program Languages Nonprocedural languages Fourth-generation languages Report generators (database reports) Query languages SQL (structured query language) Doesn’t require programmers to deal with step- by-step procedures to achieve the appropriate programming outcome Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall17

18 Development of Program Languages Natural language Fifth-generation languages Still being perfected Nonprocedural Use everyday language to program Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall18

19 Development of Program Languages Object-oriented programming (OOP) Coding is attached to basic prebuilt items called objects, which include: Data Procedures or operations called methods An interface to exchange messages with other objects Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall19

20 Development of Program Languages Object-oriented programming (OOP) (continued) Makes information hiding or encapsulation a reality Examples of object-oriented programming languages are C++, Java, and Visual Basic.NET Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall20

21 Development of Program Languages Elements of object-oriented programming Objects: units of computer information Classes: categories of objects Reusability of objects Inheritance: ability to pass on characteristics to subclasses Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall21

22 Development of Program Languages Rapid application development (RAD) Made possible by object-oriented programming Relies on reusability of objects Joint application development (JAD) Similar to RAD but involves end-user in planning Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall22

23 Development of Program Languages Advantages of OOP: Allows networked computers to query objects through middleware Does not require code to be changed when data is modified Promotes thinking in a real-world environment, resulting in more effective programs Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall23

24 A Guide to Programming Languages: One Size Doesn’t Fit All Programmers must select the programming language that can best meets the user’s needs. Two programming languages that have been used since the 1950s are: COBOL (Common Business-Oriented Language) for business applications Fortran (formula translator) for scientific/math/engineering applications Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall24

25 A Guide to Programming Languages: One Size Doesn’t Fit All Structured and modular languages Required for large-scale program development Examples Ada BASIC Visual Basic Pascal C Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall25

26 A Guide to Programming Languages: One Size Doesn’t Fit All Object-oriented languages Provide easier programming techniques Examples Smalltalk C++ Java Visual Basic.NET Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall26

27 A Guide to Programming Languages: One Size Doesn’t Fit All Web-based languages Not considered programming languages Enable the interpretation of both text and objects by browsers Two types: Markup languages Scripting languages Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall27

28 A Guide to Programming Languages: One Size Doesn’t Fit All Markup languages Define text structure through a set of instructions that are identified with tags. Content lies between tags. Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall28

29 A Guide to Programming Languages: One Size Doesn’t Fit All Types of markup languages include: HTML (Hypertext Markup Language) XML (Extensible Markup Language) XHTML (eXtensible Hypertext Markup Language Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall29

30 A Guide to Programming Languages: One Size Doesn’t Fit All Scripting languages Use basic programs called scripts to control Web page actions or responses Types of scripting languages include: VBScript JavaScript Visual Studio.NET Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall30

31 The Program Development Life Cycle Program development life cycle (PDLC) Used to overcome debugging and maintenance problems Made up of six phases, from problem definition through program implementation and maintenance Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall31

32 The Program Development Life Cycle Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall32

33 The Program Development Life Cycle Phase 1: Defining the problem Before a program can be developed, the problem to be resolve must be defined. This phase includes the definition of the program specifications, which include decisions regarding data input, required processing, output, and the user interface. Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall33

34 The Program Development Life Cycle Phase 2: Designing the program This phase develops a plan of program specifications. Top-down program design Breaks program into small, manageable, highly focused subroutines Results in better control programming, easier debugging, and efficient maintenance Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall34

35 The Program Development Life Cycle Phase 2: Designing the program (continued) Control structures Logically assembled blocks of code Used to determine how subroutines will be programmed Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall35

36 The Program Development Life Cycle Phase 2: Designing the program (continued) The basic control structures categories are: Sequence: Code performed in line-by-line order Selection (also conditional or branch): Portion of code that leads to a block of code based on conditions being met Case: A portion of code that branches to extensive coding Repetition (also looping or iteration): A portion of code that repeats Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall36

37 The Program Development Life Cycle Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall37

38 The Program Development Life Cycle Phase 2: Designing the program (continued) Algorithm A combination of control structures A step-by-step accounting of how to arrive at a solution Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall38

39 The Program Development Life Cycle Phase 2: Designing the program (continued) Program design tools used during this phase: Structured charts: show top-down design of programs Flowcharts: show logic of program Pseudocode: stylized form of writing to describe logic Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall39

40 The Program Development Life Cycle Phase 3: Coding the program Programmers take the algorithms and convert them into programming code. Syntax errors Mistakes in the construction of the programming commands Must be corrected for the program to run appropriately Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall40

41 The Program Development Life Cycle Phase 4: Testing and debugging the program All errors, not just syntax errors, must be removed. Logic errors Relate to problems in the solution’s design Cause incorrect output Program still runs even though logic errors exist Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall41

42 The Program Development Life Cycle Phase 5: Documenting the program The creation of written documentation is of paramount importance. Documentation includes: Overview of the functionality of the program Tutorials Thorough reviews of the main features Reviews of error messages Record of program design work Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall42

43 The Program Development Life Cycle Phase 6: Implementing and maintaining the program Testing of the program takes place. Users work with the software. Problems or errors to be corrected are determined. Once the program is finalized, continual maintenance and evaluation must be performed. Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall43

44 What You’ve Learned A programming language, which is made up of its own vocabulary and syntax, creates instructions that a computer understands. Machine language is based on binary code. Assembly language is similar but a little easier to understand than machine language. Both are difficult and demanding compared to later languages. Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall44

45 What You’ve Learned Unlike machine and assembly languages, third-generation (high-level) programming languages do not require programmers to have a thorough understanding of processor details. Fourth-generation languages, although even easier for programmers to use, are mostly restricted to accessing databases. Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall45

46 What You’ve Learned Object-oriented programming languages work with prebuilt objects for fast, even simpler programming when compared to earlier-generation languages. The program development life cycle (PDLC) minimizes errors and maintenance problems. Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall46

47 What You’ve Learned The six phases of the program development life cycle (PDLC) are (1) defining the problem, (2) designing the program, (3) coding the program, (4) testing and debugging the program, (5) documenting the program, and (6) implementing and maintaining the program. Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall47

48 What You’ve Learned Debugging and maintaining programs using top-down program design are simpler because program functions are divided into separate modules. Algorithms to perform any processing task can be created by programmers using sequence, selection, and repetition control structures. Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall48

49 What You’ve Learned There are two types of bugs: syntax errors, which are errors caused by faulty command structure, and logic errors, which are errors caused by faulty programming design. Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall49


Download ppt "Computers Are Your Future Tenth Edition Chapter 11: Programming Languages & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as."

Similar presentations


Ads by Google