1 chapter 13 understanding computers, 11 th edition 13 program development and programming languages...

48
1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER CHAPTER

Upload: adam-stone

Post on 02-Jan-2016

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

1Chapter 13 Understanding Computers, 11th Edition

13Program Development

and Programming Languages

TODAY AND TOMORROW

11th Edition

CHAPTERCHAPTER

Page 2: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

2Chapter 13 Understanding Computers, 11th Edition

Learning Objectives Understand the differences between structured

programming, object-oriented programming (OOP), and aspect-oriented programming (AOP).

Identify and describe the activities involved in the program development life cycle (PDLC).

Understand what constitutes good program design and list several tools that can be used by computer professionals when designing a program.

Page 3: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

3Chapter 13 Understanding Computers, 11th Edition

Learning Objectives, Cont’d Explain the three basic control structures and how they

can be used to control program flow during execution.

Discuss some of the activities involved with coding, debugging, maintaining, documenting, and ensuring the quality of programs.

List some tools that can be used to speed up or otherwise facilitate the program development process.

Describe several programming languages in use today.

Page 4: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

4Chapter 13 Understanding Computers, 11th Edition

Overview This chapter covers:

The most common approaches to program design and development

The steps in the program development life cycle (PDLC)

Tools that can facilitate program development Programming language categories Popular programming languages

Page 5: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

5Chapter 13 Understanding Computers, 11th Edition

Approaches to Program Design andDevelopment

Structured programming: programs are separated into modules or subprograms, and instructions are executed one after the other, calling the subprograms when needed

Page 6: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

6Chapter 13 Understanding Computers, 11th Edition

Approaches to Program Design andDevelopment, Cont’d

Object-oriented programming (OOP): programs consist of a collection of objects Objects: contain data and methods to

be used with that data Variables: data about the state of an

object Methods: perform actions on the

object

Page 7: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

7Chapter 13 Understanding Computers, 11th Edition

Approaches to Program Design andDevelopment, Cont’d

Object-oriented programming (OOP), cont’d: Polymorphism: Multiple methods with the same

name can perform different actions with different types of objects

Inheritance: all objects inherit the characteristics of the class in which it belongs

Aspect-oriented programming (AOP): functions are clearly separated so program components can be developed and modified individually, and the components can be easily reused

Page 8: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

8Chapter 13 Understanding Computers, 11th Edition

The Program Development Life Cycle (PDLC)

Program development: the process of creating programs

Program development life cycle (PDLC): the steps involved with creating programs

Page 9: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

9Chapter 13 Understanding Computers, 11th Edition

Problem Analysis Problem analysis: the step in the program

development life cycle in which the problem is considered and the program specifications are developed Specifications developed during the SDLC are

reviewed by the systems analyst and the programmer

Goal: to understand the functions the software must perform

Documentation: Program specifications (what it does, timetable, programming language to be used, etc)

Page 10: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

10Chapter 13 Understanding Computers, 11th Edition

Program Design Program design: the step in the program

development life cycle in which the program specifications are expanded into a complete design of the new program

Program design tools Structure charts (depict the overall organization of a

program) Program flowcharts (show graphically step-by-step

how a computer program will process data

Page 11: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

11Chapter 13 Understanding Computers, 11th Edition

Page 12: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

12Chapter 13 Understanding Computers, 11th Edition

Program Design, Cont’d Program design tools,

cont’d Pseudocode: uses

English-like statements to outline the logic of a program

Page 13: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

13Chapter 13 Understanding Computers, 11th Edition

Program Design, Cont’d Program design tools, cont’d

Data modeling: illustrates the data in an application

Often used when designing an object-oriented program

Each object is identified along with its corresponding class, class properties, and variables

Page 14: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

14Chapter 13 Understanding Computers, 11th Edition

Page 15: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

15Chapter 13 Understanding Computers, 11th Edition

Control structure: a pattern for controlling the flow of logic in a computer program Sequence control structure (series of procedures

that follow one another) Selection control structure

If-then-else Case

Repetition control structure Do-while Do-until

Program Design, Cont’d

Page 16: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

16Chapter 13 Understanding Computers, 11th Edition

Page 17: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

17Chapter 13 Understanding Computers, 11th Edition

Page 18: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

18Chapter 13 Understanding Computers, 11th Edition

Program Design, Cont’d Good program design = essential

Saves time Creates better programs

Good program design principles: Be specific (all things the program must do need to

be specified One-entry-point/one-exit-point rule No infinite loops or other logic errors (should trace

flowchart to check logic) Documentation: Design specifications (expressed using

flowcharts, pseudocode, structure charts, data models)

Page 19: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

19Chapter 13 Understanding Computers, 11th Edition

Page 20: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

20Chapter 13 Understanding Computers, 11th Edition

Program Coding Coding: the process of writing the programming

language statements to create a computer program Need to choose a programming language; consider:

Suitability Integration Standards Programmer availability Portability Development speed

Page 21: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

21Chapter 13 Understanding Computers, 11th Edition

Program Coding, Cont’d Coding standards: a list of rules designed to

standardize programming styles Make programs more universally readable and

easier to maintain Includes the proper use of comments to:

Identify the programmer and last modification date

Explain variables used in the program Identify the main parts of the program

Page 22: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

22Chapter 13 Understanding Computers, 11th Edition

Page 23: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

23Chapter 13 Understanding Computers, 11th Edition

Program Coding, Cont’d Reusable code: generic code segments that can be

used over and over again with minor modifications Can greatly reduce development time

Data Dictionary: contains information about the data used in a program, such as the names, descriptions, and rules of usage for every variable and data item used in the program Can help consistency during coding

Documentation: Documented source code (including comments)

Page 24: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

24Chapter 13 Understanding Computers, 11th Edition

Program Debugging and Testing Debugging: the process of ensuring a program is free

of errors (bugs) Before they can be debugged, coded programs need

to be translated into executable code Source code: coded program before it is

compiled

Object code: machine language version of a program

Language translator: program that converts source code to machine language

Page 25: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

25Chapter 13 Understanding Computers, 11th Edition

Program Debugging and Testing, Cont’d

Types of language translators

Compilers (combines program with other object modules and creates a finished executable program)

Interpreters (translates one line of code at one time)

Assemblers (convert assembly language programs into machine language)

Page 26: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

26Chapter 13 Understanding Computers, 11th Edition

Program Debugging and Testing, Cont’d

Preliminary debugging Syntax errors: occur when the programmer has not

followed the rules of the programming language Program won’t run; usually an error message is

displayed Logic errors: occur when the logic in a program is

wrong Program will run but produces incorrect results Dummy print statements can help locate logic

errors

Page 27: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

27Chapter 13 Understanding Computers, 11th Edition

Page 28: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

28Chapter 13 Understanding Computers, 11th Edition

Program Debugging and Testing, Cont’d

Testing: occurs after the program appears to be correct to find any additional errors Should use good test data Tests conditions that will occur when the program is

implemented Should check for coding omissions (product quantity

allowed to be < 0, etc.) Alpha test (inside organization) Beta test (outside testers)

Documentation: Completed program package (user’s manual, description of software commands, troubleshooting guide to help with difficulties, etc.)

Page 29: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

29Chapter 13 Understanding Computers, 11th Edition

Program Implementation and Maintenance

Program implementation: implemented as part of the SDLC Once the system containing the program is up and

running, the implementation process is complete

Program maintenance: process of updating software so it continues to be useful Very costly

Documentation: Amended program package

Page 30: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

30Chapter 13 Understanding Computers, 11th Edition

Tools for Facilitating Program Development

Application Lifecycle Management (ALM): describes complete systems that can be used to create and manage an application throughout its entire lifecycle,from design through testing

Page 31: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

31Chapter 13 Understanding Computers, 11th Edition

Tools for Facilitating Program Development

Application generator: software product that enables users to code new applications quickly Macro recorders (record and play back a series of

keystrokes)

Report and form generators: GUI tools that enables individuals to prepare reports and forms quickly

Often built into database programs

Page 32: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

32Chapter 13 Understanding Computers, 11th Edition

Page 33: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

33Chapter 13 Understanding Computers, 11th Edition

Tools for Facilitating Program Development

Software-asset management tools: designed to help facilitate reusable code Store and organized tested software components

so they can be inserted into new applications quickly and efficiently

Device software development tools: assist with developing software to be used on devices, such as cars, ATM machines, consumer devices, etc.

Page 34: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

34Chapter 13 Understanding Computers, 11th Edition

Programming Languages Programming language: a set of rules used to write

computer programs Programs are written using a programming

software package for the selected programming language

Categories of programming languages Low-level languages (difficult to code in; machine

dependent) Machine language (1s and 0s) Assembly language (includes some words

and symbols)

Page 35: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

35Chapter 13 Understanding Computers, 11th Edition

Page 36: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

36Chapter 13 Understanding Computers, 11th Edition

Programming Languages Categories of programming languages, cont’d

High-level languages (closer to natural languages; easier to write in)

Includes third-level procedural languages such as BASIC, COBOL, Pascal, and C, as well as newer object-oriented languages such as C++, C#, and Java)

Fourth-generation languages (4GLs): even closer to natural languages and easier to work with than 3GLs

Includes structured query language (SQL) used with databases

Page 37: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

37Chapter 13 Understanding Computers, 11th Edition

Programming Languages Categories of programming languages, cont’d

Natural programming languages (user can communicate in their native language)

Doesn’t have to follow program syntax In the infancy stage

Visual programming languages (uses a graphical programming environment)

User can use mouse and graphical interface and the code is automatically generated

Visual versions of many programming languages

Page 38: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

38Chapter 13 Understanding Computers, 11th Edition

Popular Programming Languages FORTRAN: high-level programming language used

for mathematical, scientific, and engineering applications Efficient

Page 39: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

39Chapter 13 Understanding Computers, 11th Edition

COBOL: designed for business transaction processing Being

phased out in many organ-izations

Popular Programming Languages, Cont’d

Page 40: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

40Chapter 13 Understanding Computers, 11th Edition

Pascal: used to teach structured programming; especially appropriate for use in math and science appli-cations

Popular Programming Languages, Cont’d

Page 41: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

41Chapter 13 Understanding Computers, 11th Edition

BASIC: easy-to-learn, high-level programming language that was developed to be used by beginning programmers

Visual Basic:object-oriented, fourth-generation version of BASIC

Popular Programming Languages, Cont’d

Page 42: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

42Chapter 13 Understanding Computers, 11th Edition

C, C++, and C#: versions of the highly efficient C programming language C++ and

C# are object-oriented

Popular Programming Languages, Cont’d

Page 43: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

43Chapter 13 Understanding Computers, 11th Edition

Java: high-level, object-oriented programming language frequently used for Web-based applications Platform independence is one of Java’s biggest

advantages Any operating system or browser that

understands Java bytecode (compiled Java programs) can run Java applications

Is one of the most popular programming languages today

Popular Programming Languages, Cont’d

Page 44: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

44Chapter 13 Understanding Computers, 11th Edition

Page 45: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

45Chapter 13 Understanding Computers, 11th Edition

Java, cont’d Java applets: small programs that are designed to

be inserted into Web pages and run using a Java-enabled Web browser

The .class file containing the applet’s code must be stored with the Web site files

HTML code is used to insert the applet and specify parameters to customize the applet

Java applets that run on the server instead of on the client computer are called servlets

Popular Programming Languages, Cont’d

Page 46: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

46Chapter 13 Understanding Computers, 11th Edition

Page 47: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

47Chapter 13 Understanding Computers, 11th Edition

Page 48: 1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER

48Chapter 13 Understanding Computers, 11th Edition

Summary Approaches to Program Design and Development

The Program Development Life Cycle (PDLC)

Tools for Facilitating Program Development

Programming Languages