Programming Languages and Program Develompent

57
Discovering Computers 2011 Living in a Digital World Computers 2011

Transcript of Programming Languages and Program Develompent

Page 1: Programming Languages and Program Develompent

Discovering Computers 2011

Living in a Digital World

Computers 2011

Page 2: Programming Languages and Program Develompent

Objectives OverviewObjectives Overview

Identify and discuss the  Identify and discuss the characteristics of theseDifferentiate between 

machine and assembly languages

purpose of procedural programming languages, 

and describe the features of C and COBOL

characteristics of these object‐oriented 

programming languages and program development C and COBOL p g p

tools

Identify the uses of other programming languages 

and program development Describe various ways to 

develop Web pagestools

Discovering Computers 2011: Living in a Digital World Chapter 13

2See Page 663for Detailed Objectives

Page 3: Programming Languages and Program Develompent

Objectives OverviewObjectives Overview

Identify the uses of l lti di

List the six steps in the d l tpopular multimedia 

authoring programsprogram development 

life cycle

l h bDifferentiate between structured design and

Explain the basic control structures and design tools used instructured design and 

object‐oriented designdesign tools used in designing solutions to programming problemsprogramming problems

Discovering Computers 2011: Living in a Digital World Chapter 13

3See Page 663for Detailed Objectives

Page 4: Programming Languages and Program Develompent

Computer Programs d iand Programming Languages

• A computer program is a series of instructions that directs a computer to perform tasksp p– Created by a programmer using a programming languagelanguage

Discovering Computers 2011: Living in a Digital World Chapter 13

4Pages 664 – 665Figure 13‐1

Page 5: Programming Languages and Program Develompent

Low‐Level LanguagesLow Level Languages

• Machine language is the first generation of programming languages

• Only language the computer directly recognizes

Discovering Computers 2011: Living in a Digital World Chapter 13

5Page 665Figure 13‐2

Page 6: Programming Languages and Program Develompent

Low‐Level LanguagesLow Level Languages

A bl l i h• Assembly language is the second generation of programming languagesprogramming languages

• Programmer writes instructions using  gsymbolic instruction codes

• A source programcontains the code to be converted to machineconverted to machine language

Discovering Computers 2011: Living in a Digital World Chapter 13

6Pages 665 – 666Figure 13‐3

Page 7: Programming Languages and Program Develompent

Procedural LanguagesProcedural Languages

• In a procedural language, the programmer writes instructions that tell the computer what to paccomplish and how to do it– Third‐generation language (3GL)– Third‐generation language (3GL)

A ilA ilA compiler translates an entire program before 

A compiler translates an entire program before  An interpreter converts 

d dAn interpreter converts 

d dexecuting itexecuting it and executes one code statement at a time

and executes one code statement at a time

Discovering Computers 2011: Living in a Digital World Chapter 13

7Pages 666 ‐ 667

Page 8: Programming Languages and Program Develompent

Procedural LanguagesProcedural Languages

Discovering Computers 2011: Living in a Digital World Chapter 13

8Page 667Figures 13‐4 – 13‐5

Page 9: Programming Languages and Program Develompent

Procedural LanguagesProcedural Languages

• The C programming language is used to write many of today’s programsy y p g

Click to view Web Link,click Chapter 13, Click Web Link from left

Discovering Computers 2011: Living in a Digital World Chapter 13

9Page 668Figure 13‐6

navigation, then click C below Chapter 13

Page 10: Programming Languages and Program Develompent

Procedural LanguagesProcedural Languages

• COBOL (COmmon Business‐Oriented Language) is designed for business applications, but easy to g pp yread because of the English‐like statements

Discovering Computers 2011: Living in a Digital World Chapter 13

10Pages 668 – 669Figure 13‐7

Page 11: Programming Languages and Program Develompent

Object‐Oriented Programming Languages d l land Program Development Tools

• An object‐oriented programming (OOP) language allows programmers the ability to reuse and modify existing objects

• Other advantages include:

Objects can be reused

Programmers create applications reused pp

faster

Work well in a RAD environment

Most program development tools 

are IDEs

Discovering Computers 2011: Living in a Digital World Chapter 13

11Page 669

are IDEs

Page 12: Programming Languages and Program Develompent

Object‐Oriented Programming Languages d l land Program Development Tools

• Java is an object‐oriented programming language developed by Sun Microsystems

• The Just‐in‐time (JIT) compiler to convert the bytecodeinto machine‐dependent code

Click to view Web Link,click Chapter 13, Click Web Link from left

Discovering Computers 2011: Living in a Digital World Chapter 13

12Page 670Figure 13‐8

navigation, then click Java Platforms below Chapter 13

Page 13: Programming Languages and Program Develompent

Object‐Oriented Programming Languages d l land Program Development Tools

• The Microsoft .NET Framework allows almost any type of program to run on the Internet or an yp p ginternal business network, as well as computers and mobile devicesand mobile devices

• Features include:

CLR (Common Language Runtime)

Classes

Discovering Computers 2011: Living in a Digital World Chapter 13

13Page 670

Page 14: Programming Languages and Program Develompent

Object‐Oriented Programming Languages d l land Program Development Tools

C i i f• C++ is an extension of the C programming languagelanguage

• C# is based on C++ and was developed bywas developed by Microsoft

• F# combines the• F# combines the benefits of an object‐oriented language withoriented language with those of a functional languageg g

Discovering Computers 2011: Living in a Digital World Chapter 13

14Page 671Figure 13‐9

Page 15: Programming Languages and Program Develompent

Object‐Oriented Programming Languages d l land Program Development Tools

Visual Studio is Microsoft’s suite of program development toolsprogram development tools

Vi l C# biVisual Basic is 

based on the BASIC Visual C++ is based

Visual C# combines the programming elements of C++based on the BASIC 

programming language

Visual C++ is based on C++

elements of C++ with an easier, 

rapid‐development g g p penvironment

Discovering Computers 2011: Living in a Digital World Chapter 13

15Pages 671 ‐ 673

Page 16: Programming Languages and Program Develompent

Object‐Oriented Programming Languages d l land Program Development Tools

Click to view Web Link,click Chapter 13, Click Web Link from left

Discovering Computers 2011: Living in a Digital World Chapter 13

16Pages 671 – 672Figure 13‐10

navigation, then click Visual Studio Tools for Officebelow Chapter 13

Page 17: Programming Languages and Program Develompent

Object‐Oriented Programming Languages d l land Program Development Tools

A visual programming language is a language that uses a visual or graphical interface for creating all source code

B l d’ D l hi i f lBorland’s Delphi is a powerful program development tool that is ideal for building large‐scale enterprise and Web applications in a RAD environment

Discovering Computers 2011: Living in a Digital World Chapter 13

17Page 673

Page 18: Programming Languages and Program Develompent

Object‐Oriented Programming Languages d l land Program Development Tools

Discovering Computers 2011: Living in a Digital World Chapter 13

18Page 673Figure 13‐11

Page 19: Programming Languages and Program Develompent

Object‐Oriented Programming Languages d l land Program Development Tools

• PowerBuilder is a powerful program development RAD tool

• Best suited for Web‐based, .NET, and large‐scale enterprise object‐oriented applications

Discovering Computers 2011: Living in a Digital World Chapter 13

19Page 674Figure 13‐12

Page 20: Programming Languages and Program Develompent

Other Programming Languages d l land Development Tools

• A 4GL (fourth‐generation language) is a nonprocedural language that enables users and p g gprogrammers to access data in a database– One popular 4GL is SQL– One popular 4GL is SQL

Discovering Computers 2011: Living in a Digital World Chapter 13

20Page 674Figure 13‐13

Page 21: Programming Languages and Program Develompent

Other Programming Languages d l land Development Tools

• Classic programming languages include:

AdAd ALGOLALGOL APLAPL BASICBASICAdaAda ALGOLALGOL APLAPL BASICBASIC

ForthForth FORTRANFORTRAN HyperTalkHyperTalk LISPLISP

LogoLogo Modula‐2Modula‐2 PascalPascal PILOTPILOT

PL/1PL/1 PrologProlog RPGRPG SmalltalkSmalltalk

Discovering Computers 2011: Living in a Digital World Chapter 13

21Page 675Figure 13‐14

PL/1PL/1 PrologProlog RPGRPG SmalltalkSmalltalk

Page 22: Programming Languages and Program Develompent

Other Programming Languages d l land Development Tools

• An application generator is a program that creates source code or machine code from a specification of the required functionality– Often bundled as part of a DBMS

Discovering Computers 2011: Living in a Digital World Chapter 13

22Page 676Figure 13‐15

Page 23: Programming Languages and Program Develompent

Other Programming Languages d l land Development Tools

• A macro is a series of statements that instructs an application how to complete a taskpp p

• You usually create the macro in one of two ways:R d th ith d– Record the macro with a macro recorder

– Write the macro

Click to view Web Link,click Chapter 13, Click Web Link from left

Discovering Computers 2011: Living in a Digital World Chapter 13

23Pages 676 ‐ 677

navigation, then click Macros below Chapter 13

Page 24: Programming Languages and Program Develompent

Other Programming Languages d l land Development Tools

Discovering Computers 2011: Living in a Digital World Chapter 13

24Page 677Figure 13‐16

Page 25: Programming Languages and Program Develompent

Web Page DevelopmentWeb Page Development

• HTML is a special formatting language that programmers use to format documents for display on the Web

• XHTML is a markup language that allows Web sites to be displayed more easily on mobile devices

Discovering Computers 2011: Living in a Digital World Chapter 13

25Page 678Figure 13‐17

Page 26: Programming Languages and Program Develompent

Web Page DevelopmentWeb Page Development

• XML allows Web developers to create customized tags and use predefined tags to display content g p g p yappropriately on various devices– WML is a subset of XML and is used to design pages– WML is a subset of XML and is used to design pages for microbrowsers

T li i f XML RSS 2 0 d ATOM• Two applications of XML are RSS 2.0 and ATOM

Click to view Web Link,click Chapter 13, Click Web Link from left

Discovering Computers 2011: Living in a Digital World Chapter 13

26Page 679

navigation, then click XML below Chapter 13

Page 27: Programming Languages and Program Develompent

Web Page DevelopmentWeb Page Development

Discovering Computers 2011: Living in a Digital World Chapter 13

27Page 679Figure 13‐18

Page 28: Programming Languages and Program Develompent

Web Page DevelopmentWeb Page Development

• Web browsers can execute short programs to add interactive elements to Web pages

• To send and receive information between your computer and a Web server, these programs use the CGI (common gateway interface)

Scripts Appletsp pp

Servlets ActiveX controls

Discovering Computers 2011: Living in a Digital World Chapter 13

28Page 680

controls

Page 29: Programming Languages and Program Develompent

Web Page DevelopmentWeb Page Development

Discovering Computers 2011: Living in a Digital World Chapter 13

29Page 681Figure 13‐19

Page 30: Programming Languages and Program Develompent

Web Page DevelopmentWeb Page Development

• Programmers write scripts, applets, servlets, or ActiveX controls using a variety of languagesg y g g

JavaScript Perl PHP

R T l VBS i tRexx Tcl VBScriptClick to view Web Link,click Chapter 13, Click Web Link from left

Discovering Computers 2011: Living in a Digital World Chapter 13

30Pages 682 ‐ 683

navigation, then click PHP below Chapter 13

Page 31: Programming Languages and Program Develompent

Web Page DevelopmentWeb Page Development

Discovering Computers 2011: Living in a Digital World Chapter 13

31Page 682Figure 13‐20

Page 32: Programming Languages and Program Develompent

Web Page DevelopmentWeb Page Development

Dynamic HTML  (DHTML) allows Web developers to include more graphical interestdevelopers to include more graphical interest and interactivity

d l h ( ) h f f h l b h ld• Cascading style sheets (CSS) contain the formats for how a particular object should be displayed

Ruby on Rails (RoR) provides technologies for developing object‐oriented, database‐driven Web sitesWeb sites

Click to view Web Link,click Chapter 13, Click Web Link from left

Discovering Computers 2011: Living in a Digital World Chapter 13

32Page 683

Web Link from left navigation, then click Cascading Style Sheetsbelow Chapter 13

Page 33: Programming Languages and Program Develompent

Web Page DevelopmentWeb Page Development

• Web 2.0 allows Web sites to provide a means for users to:

Share personal  Allow users to modify Web sitep

information modify Web site content

Have application ppsoftware built into the site

Discovering Computers 2011: Living in a Digital World Chapter 13

33Page 684

Page 34: Programming Languages and Program Develompent

Web Page DevelopmentWeb Page Development

• Most Web 2.0 sites use APIs– An API enables programmers to interact with an p genvironment such as a Web site or operating system

Click to view Web Link,click Chapter 13, Click Web Link from left

Discovering Computers 2011: Living in a Digital World Chapter 13

34Page 684Figure 13‐21

Web Link from left navigation, then click APIs below Chapter 13

Page 35: Programming Languages and Program Develompent

Web Page DevelopmentWeb Page Development

• Web page authoring software can create sophisticated Web pages that include images, p p g gvideo, audio, animation, and other effects

Dreamweaver Expression Web

Flash SharePoint Designer

Discovering Computers 2011: Living in a Digital World Chapter 13

35Page 685

Page 36: Programming Languages and Program Develompent

Multimedia Program DevelopmentMultimedia Program Development

• Multimedia authoring software allows programmers to combine text, graphics, p g g panimation, audio, and video in an interactive presentationpresentation

ToolBookToolBook DirectorDirector

Discovering Computers 2011: Living in a Digital World Chapter 13

36Page 685

Page 37: Programming Languages and Program Develompent

Multimedia Program DevelopmentMultimedia Program Development

Discovering Computers 2011: Living in a Digital World Chapter 13

37Page 685Figure 13‐22

Page 38: Programming Languages and Program Develompent

Program DevelopmentProgram Development

• Program development consists of a series of steps programmers use to build computer programsp g p p g

Discovering Computers 2011: Living in a Digital World Chapter 13

38Page 686Figure 13‐23

Page 39: Programming Languages and Program Develompent

Step 1 – Analyze RequirementsStep 1  Analyze Requirements

• To initiate program development, programmer:– Reviews the requirementsq

– Meets with the systems analyst and users

Identifies input processing and output– Identifies input, processing, and output• IPO chart

Discovering Computers 2011: Living in a Digital World Chapter 13

39Page 687Figure 13‐24

Page 40: Programming Languages and Program Develompent

Step 2 – Design SolutionStep 2  Design Solution

• Design a solution algorithm

• In structured design, the programmer typicallyIn structured design, the programmer typically begins with a general design and moves toward a more detailed designmore detailed design

• Programmers use a hierarchy chart to show program modules graphically

Discovering Computers 2011: Living in a Digital World Chapter 13

40Pages 687 ‐ 688

Page 41: Programming Languages and Program Develompent

Step 2 – Design SolutionStep 2  Design Solution

Discovering Computers 2011: Living in a Digital World Chapter 13

41Page 688Figure 13‐25

Page 42: Programming Languages and Program Develompent

Step 2 – Design SolutionStep 2  Design Solution

• With object‐oriented(OO) design, the programmer packages the data and the program into a single object– Encapsulation

Click to view Web Link,click Chapter 13, Click Web Link from left

Discovering Computers 2011: Living in a Digital World Chapter 13

42Page 689Figure 13‐26

Web Link from left navigation, then click Object-Oriented Designbelow Chapter 13

Page 43: Programming Languages and Program Develompent

Step 2 – Design SolutionStep 2  Design Solution

• The sequence control structure shows one or more actions following each other in order

Discovering Computers 2011: Living in a Digital World Chapter 13

43Page 689Figure 13‐27

Page 44: Programming Languages and Program Develompent

Step 2 – Design SolutionStep 2  Design Solution

• The selection control structure tells the program which action to take, based on a certain condition– If‐then‐else

– Case

Discovering Computers 2011: Living in a Digital World Chapter 13

44Page 689Figure 13‐28

Page 45: Programming Languages and Program Develompent

Step 2 – Design SolutionStep 2  Design Solution

Discovering Computers 2011: Living in a Digital World Chapter 13

45Page 690Figure 13‐29

Page 46: Programming Languages and Program Develompent

Step 2 – Design SolutionStep 2  Design Solution

• The repetition control structure enables a program to perform one or more actions repeatedly as long as a certain condition is met

Discovering Computers 2011: Living in a Digital World Chapter 13

46Page 690Figures 13‐30 – 13‐31

Page 47: Programming Languages and Program Develompent

Step 2 – Design SolutionStep 2  Design Solution

• A program flowchart graphically shows the logic in a solution algorithmg

Discovering Computers 2011: Living in a Digital World Chapter 13

47Page 691Figure 13‐33

Page 48: Programming Languages and Program Develompent

Step 2 – Design SolutionStep 2  Design Solution

• Flowcharting softwaremakes it easy to modify and update flowchartsp– SmartDraw

Visio– Visio

Click to view Web Link,click Chapter 13, Click Web Link from left

Discovering Computers 2011: Living in a Digital World Chapter 13

48Page 692Figure 13‐34

Web Link from left navigation, then click Flowcharting Softwarebelow Chapter 13

Page 49: Programming Languages and Program Develompent

Step 2 – Design SolutionStep 2  Design Solution

• Pseudocode uses a condensed form of English to convey program logic

Discovering Computers 2011: Living in a Digital World Chapter 13

49Page 692Figure 13‐35

Page 50: Programming Languages and Program Develompent

Step 2 – Design SolutionStep 2  Design Solution

• UML (Unified Modeling Language) has been adopted as a standard notation for object p jmodeling and development

Discovering Computers 2011: Living in a Digital World Chapter 13

50Page 693Figure 13‐37

Page 51: Programming Languages and Program Develompent

Step 3 – Validate DesignStep 3  Validate Design

• Check for logic errors using test data

Develop various 

sets of test

Determine the 

expected

Step through the

Compare the results

Repeat steps for each set ofsets of test 

dataexpected result

the algorithm

the results each set of test data

Discovering Computers 2011: Living in a Digital World Chapter 13

51Pages 693 ‐ 694

Page 52: Programming Languages and Program Develompent

Step 4 – Implement DesignStep 4  Implement Design

l i f h d i i l d i• Implementation of the design includes using a program development tool that assists the 

bprogrammer by:– Generating or providing some or all code– Writing the code that translates the design into a computer programC ti th i t f– Creating the user interface

• Extreme programming is a strategy where i di t l b i di d t tiprogrammers immediately begin coding and testing 

solutions as soon as requirements are defined

Discovering Computers 2011: Living in a Digital World Chapter 13

52Pages 694 ‐ 695

Page 53: Programming Languages and Program Develompent

Step 5 – Test SolutionStep 5  Test Solution

The goal of program testing is to ensure the g p g gprogram runs correctly and is error free

• Errors include syntax errors and logic errors• Debugging the program involves removing the bugs• A beta is a program that has most or all of its features and functionality implementedy p

Click to view Web Link,click Chapter 13, Click Web Link from left navigation, then click

Discovering Computers 2011: Living in a Digital World Chapter 13

53Pages 695 ‐ 696

Beta Testersbelow Chapter 13

Page 54: Programming Languages and Program Develompent

Step 6 – Document SolutionStep 6  Document Solution

• In documenting the solution, the programmer performs two activities:p

Review the program codeReview the 

program codeReview all the documentationReview all the documentation

Discovering Computers 2011: Living in a Digital World Chapter 13

54Page 696

Page 55: Programming Languages and Program Develompent

Video: Electronic Arts Going MobileVideo: Electronic Arts Going Mobile

CLICK TO START

Discovering Computers 2011: Living in a Digital World Chapter 13

55

CLICK TO START

Page 56: Programming Languages and Program Develompent

SummarySummary

Various programming languages used to

A variety of Web development andlanguages used to 

create computer programs

development and multimedia 

development tools

Steps in the program development life cycle p yand tools used to make this process efficient

Discovering Computers 2011: Living in a Digital World Chapter 13

56Page 696

Page 57: Programming Languages and Program Develompent

Discovering Computers 2011

Living in a Digital World

Computers 2011

Chapter 13 Complete