discovering computers 2009

54
Discovering Computers 2009 Chapter 13 Programming Languages and Program Development

Upload: aabbccddeeee

Post on 16-Dec-2014

2.192 views

Category:

Documents


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Discovering Computers 2009

Discovering Computers 2009

Chapter 13 Programming

Languages and Program

Development

Page 2: Discovering Computers 2009

Chapter 13 Objectives

Next

Describe various ways to develop Web pages including HTML, scripting languages, DHTML, XML, WML, and Web page

authoring software

Describe various ways to develop Web pages including HTML, scripting languages, DHTML, XML, WML, and Web page

authoring softwareDifferentiate between machine

and assembly languagesDifferentiate between machine

and assembly languages

Identify and discuss the purpose of procedural programming languages

Identify and discuss the purpose of procedural programming languages

Identify and discuss the characteristics of object-oriented programming languages and

program development tools

Identify and discuss the characteristics of object-oriented programming languages and

program development tools

Identify the uses of other programming languages and other program development

tools

Identify the uses of other programming languages and other program development

tools

Identify the uses of popular multimedia authoring programs

Identify the uses of popular multimedia authoring programs

List the six steps in the program development cycle

List the six steps in the program development cycle

Differentiate between structured design and object-oriented design

Differentiate between structured design and object-oriented design

Explain the basic control structures and design tools used in designing solutions to

programming problems

Explain the basic control structures and design tools used in designing solutions to

programming problems

Page 3: Discovering Computers 2009

Computer Programs and Programming Languages

What is a computer program?

p. 664 Fig. 13-1 Next

A series of instructions that directs a computer to perform tasks Programming language—used to communicate

instructions to a computer

Page 4: Discovering Computers 2009

Computer Programs and Programming Languages

What are low-level languages and high-level languages?

p. 664 - 665 Next

High-level language

High-level language

Low-levellanguage

Low-levellanguage

Machine-dependentruns only on one type of computer

Machine-dependentruns only on one type of computer

Often machine-independentcan run on many different

types of computers and operating systems

Often machine-independentcan run on many different

types of computers and operating systemsMachine and assembly languages

are low-level

Machine and assembly languages are low-level

Page 5: Discovering Computers 2009

Low-Level Languages

What is machine language?

p. 665 Fig. 13-2 Next

The only language the computer directly recognizes

Uses a series of binary digits (1s and 0s) with a combination of numbers and letters that represent binary digits Coding in machine language is tedious and time-consuming.

Page 6: Discovering Computers 2009

Low-Level Languages

What is assembly language?

p. 666 Fig. 13-3 Next

Instructions made up of symbolic instruction codes, meaningful abbreviations and codes

Source program contains code to be converted to machine language

Symbolic address is a meaningful name that identifies a storage location,

Page 7: Discovering Computers 2009

Often called third-generation third-generation language (3GL)language (3GL)

Procedural Languages

What is a procedural language?

p. 666 Next

Uses series of English-like words and arithmetic

operators to write instructions

Programmer writes instructions that tell

computer what to accomplish and how to do it

Simplify the program development process for the programmer.

Page 8: Discovering Computers 2009

Procedural Languages

What is a compiler?

p. 667 Fig. 13-4 Next

Program that converts entire source program into machine language before executing it

Machine Language

Contains the source code and a list of errors

Page 9: Discovering Computers 2009

Procedural Languages

What is an interpreter?

p. 667 Fig. 13-5 Next

Program that translates and executes one program code statement at a time

Does not produce object program

Page 10: Discovering Computers 2009

Procedural Languages

What is COBOL?

p. 668 Fig. 13-6 Next

Designed for business applications English-like statements make code easy to read, write,

and maintain Common Business-Oriented Language Especially is useful for processing transactions such as

payroll and billing.

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

Page 11: Discovering Computers 2009

Procedural Languages

What is C?

p. 668 Fig. 13-7 Next

Powerful language originally designed to write system software

Requires professional programming skills

Page 12: Discovering Computers 2009

Object-Oriented Programming Languages

What is an object-oriented programming (OOP) language?

p. 669 Next

Used to implement

object-oriented design

Major benefit is ability to reuse and

modify existing objects

Event-driven—checks for

and responds to set of events

Java, C++, C#, and Visual Basic

are complete object-oriented

languagesObject is item that contains data and

procedures that act on

data

Event is action to

which program responds

Page 13: Discovering Computers 2009

Object-Oriented Programming Languages

What is Java?

Next

Developed by Sun Microsystems

Uses just-in-time (JIT) compiler to convert bytecode into machine-dependent code

A java applet is a small Java program that runs inside another program such as a web browser.

Page 14: Discovering Computers 2009

Object-Oriented Programming Languages

What is C++?

p. 670 Fig. 13-9 Next

Includes all elements of C, plus additional features for working with object-oriented concepts

Used to develop database and Web applications

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

Page 15: Discovering Computers 2009

Object-Oriented Programming Languages

What is C#?

p. 670 Next

Object-oriented programming language based on C++ Accepted as a standard for Web applications and

XML-based Web services Uses a JIT compiler Resulting code is called Microsoft Intermediate

Language (MSIL)

Page 16: Discovering Computers 2009

Object-Oriented Programming Languages

What is Visual Studio?

p. 670 - 672 Fig. 13-10 Next

.NET is a set of technologies that allows programs to run on Internet or an internal business network, as well as stand-alone computers and mobile devices

Comprised of Visual Basic, Visual C++, and Visual C#

Click to view Web Link,click Chapter 13, Click Web Link from left navigation, then click Visual Studio Tools for Officebelow Chapter 13

Step 1. The developer designs the user interface.

Step 2. The developer assigns properties to each object on the form.

Step 3. The developerwrites code to define the action of each command button.

Step 4. The developer tests the program.

Page 17: Discovering Computers 2009

Object-Oriented Programming Languages

What is Delphi?

p. 672 Fig. 13-11 Next

Powerful program development tool Ideal for large-scale enterprise and Web applications

Page 18: Discovering Computers 2009

Object-Oriented Programming Languages

What is PowerBuilder?

p. 673 Fig. 13-12 Next

Another powerful visual programming tool

Best suited for Web-based and large-scale

enterprise object-oriented applications

Page 19: Discovering Computers 2009

Object-Oriented Programming LanguagesWhat is a visual programming language (Ex: Alice, Mindscript, Prograph)?

p. 669 and 673 Next

Programmer writes and implements

program in segments

Visual programming environment (VPE) allows developers to

drag and drop objects to build programs

Often used in Often used in RAD RAD (rapid application (rapid application

development)development) environmentenvironment

Provides visual or Provides visual or graphical interface for graphical interface for creating source codecreating source code

Page 20: Discovering Computers 2009

Other Programming Languages

What are nonprocedural languages and program development tools?

p. 674 and 676 Next

Nonprocedural Language

The programmer writes English-like instructions or interacts with a visual environment to retrieve data from files or a

database

Nonprocedural Language

The programmer writes English-like instructions or interacts with a visual environment to retrieve data from files or a

database

Program Development Tools

User-friendly programs designed to assist both

programmers and users in creating programs

Program Development Tools

User-friendly programs designed to assist both

programmers and users in creating programs

Page 21: Discovering Computers 2009

Other Programming Languages

What is RPG (Report Program Generator)?

p. 674 Fig. 13-13 Next

Nonprocedural language used for generating reports, accessing data, and updating data

Page 22: Discovering Computers 2009

Other Programming Languages

What is a fourth-generation language (4GL)?

p. 674 Fig. 13-14 Next

Nonprocedural language that allows access to data in database

Popular 4GL is SQL, query language that allows users to manage data in relational DBMS

Page 23: Discovering Computers 2009

Other Programming Languages

What are other available programming languages?

p. 675 Fig. 13-15 Next

ALGOLALGOLALGOLALGOLAdaAdaAdaAda APLAPLAPLAPL

BASICBASICBASICBASIC HyperTalkHyperTalkHyperTalkHyperTalkFORTRANFORTRANFORTRANFORTRANForthForthForthForth

LISPLISPLISPLISP Modula-2Modula-2Modula-2Modula-2LogoLogoLogoLogo

PascalPascalPascalPascal PrologPrologPrologPrologPL/1PL/1PL/1PL/1PILOTPILOTPILOTPILOT

SmalltalkSmalltalkSmalltalkSmalltalk

Page 24: Discovering Computers 2009

Other Program Development Tools

What is an application generator?

p. 676 Fig. 13-16 Next

Program that creates source code or machine code from specification

Consists of report writer, form, and menu generator Form provides areas

for entering data

Page 25: Discovering Computers 2009

Other Program Development Tools

What is a macro?

p. 676 - 677 Fig. 13-17 Next

Series of statements that instructs an application how to complete a task

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

*Record the macro

*Write the macro

Page 26: Discovering Computers 2009

Web Page Development

What is HTML (Hypertext Markup Language)?

p. 678 Fig. 13-18 Next

Used to create Web pages

Page 27: Discovering Computers 2009

Web Page Development

How are special effects and interactive elements added to a Web page?

p. 679 Next

CounterCountertracks

number of visitors to Web site

Image mapImage mapgraphic

image that points to

URL

ScriptScriptinterpreted

program that runs on client

AppletAppletusually runs

on client, but is compiled. Faster than

scriptProcessing Processing

formformcollects data from visitors to Web site

ServletServletapplet that

runs on server

ActiveX ActiveX controlcontrol

small program that runs on

client

+ Cookies, shopping carts, games

Page 28: Discovering Computers 2009

Web Page Development

What is the common gateway interface (CGI)?

p.679 - 680 Fig. 13-19 Next

To send and receive information between your computer and a Web server, the script, applet, or servlet uses the CGI

Communications standard that defines how Web server communicates with outside sources CGI script—program that

manages sending and receiving across CGI (in the form of a script,

applet, servlet, or ActiveX control.)

Page 29: Discovering Computers 2009

How a CGI script works

Page 30: Discovering Computers 2009

Web Page Development

What is a scripting language?

p. 680 - 681 Fig. 13-20 Next

Typically easy to learn and use JavaScript Perl (Practical Extraction

and Report Language) PHP (PHP: Hypertext

Preprocessor) Rexx (Restructured

eXtended eXecutor) TCL (Tool Command

Language) VBScript (Visual Basic,

Scripting Edition)Click to view Web Link, click Chapter 13, Click Web Link from left navigation, then click PHP below Chapter 13

JavaScript Code

Page 31: Discovering Computers 2009

Web Page Development

What is dynamic HTML (DHTML)?

p. 682 Fig. 13-21 Next

Allows developers to include more graphical interest and interactivity in a Web page, without the Web page accessing the Web server.

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

Page 32: Discovering Computers 2009

Web Page Development

What are XHTML, XML, and WML?

p. 682 - 683 Next

XHTML XHTML (Extensible HTML)

enables Web sites to be displayed more easily on microbrowsers

XML XML (Extensible Markup Language)

allows developers to create customized tags

WMLWML (Wireless Markup Language)

allows developers to design pages specifically for microbrowsers

Includes features of HTML and XML

Many Internet-enabled smart phones and PDAs

use WML as their markup language

Server sends entire record to client, enabling client to do much of processing without

going back to server RSS 2.0 and

ATOM

Page 33: Discovering Computers 2009

Web Page Development

What is Ajax?

p. 683 Next

Stands for Asynchronous JavaScript and XML Method of creating interactive Web applications designed

to provide immediate response Combines JavaScript, HTML or XHTML, XML, and

cascading style sheets Google Maps and Flickr use Ajax

Page 34: Discovering Computers 2009

Web Page Development

What is Ruby on Rails (RoR)?

p. 683 Next

Also called Rails Open source framework that provides technologies for

developing object-oriented, database-driven Web sites Ruby is derived from a variety of languages, including Ada,

LISP, Perl, and Smalltalk

Page 35: Discovering Computers 2009

Web Page Development

What is Web page authoring software?

p. 683 Next

Creates sophisticated Web pages without using HTML Generates HTML

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

Page 36: Discovering Computers 2009

Multimedia Program DevelopmentWhat is multimedia authoring software?

p. 684 Fig. 13-22 Next

Combines text, graphics, animation, audio, and video into interactive presentation

Used for computer-based training (CBT) and Web-based training (WBT)

Software includes Toolbook, and Director

Page 37: Discovering Computers 2009

The Program Development CycleWhat is the program development cycle?

p. 685 - 686 Fig. 13-23 Next

Steps programmers use to build computer programs Programming

team—Group of programmers working on program

Page 38: Discovering Computers 2009

Step 1 — Analyze Requirements

What is involved in analyzing the requirements?

p. 686 - 687 Fig. 13-24 Next

1. Review requirements2. Meet with systems analyst and users3. Identify input, output, processing, and data

components IPO chart—Identifies program’s input, processing, and

output components

Page 39: Discovering Computers 2009

Programmer Programmer begins with general begins with general

design and moves toward design and moves toward detailed designdetailed design

Step 2 — Design Solution

What is involved in designing the solution?

p. 687 Next

Object-oriented Object-oriented designdesign

Structured Structured designdesign, sometimes , sometimes

called top-down designcalled top-down design

Two Two approachesapproaches

Devise Devise solution solution algorithm, algorithm, step-by-step step-by-step procedure to procedure to solve problemsolve problem

Page 40: Discovering Computers 2009

Step 2 — Design Solution

What is a hierarchy chart?

p. 687 Fig. 13-25 Next

Shows program modules graphically Also called structure chart

Page 41: Discovering Computers 2009

Step 2 — Design Solution

What is object-oriented (OO) design?

p. 688 Fig. 13-26 Next

Programmer packages data and program into single unit, an object Objects are grouped into classes Class diagram represents hierarchical

relationships of classes graphically

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

Page 42: Discovering Computers 2009

Step 2 — Design Solution

What is a sequence control structure?

p. 688 Fig. 13-27 Next

Control structure that shows actions following each other in order Control structure depicts

logical order of program instructions

Page 43: Discovering Computers 2009

Step 2 — Design Solution

What is a selection control structure?

p. 689 Fig. 13-28 Next

Tells program which action to take, based on a certain condition

Two types Case control structure If-then-else control

structure—yields one of two possibilities: true or false

Page 44: Discovering Computers 2009

Step 2 — Design Solution

What is a case control structure?

p. 689 Fig. 13-29 Next

Yields one of three or more possibilities

Page 45: Discovering Computers 2009

Step 2 — Design Solution

What is a repetition control structure?

p. 689 - 690 Figs. 13-30–13-31 Next

Enables program to perform one or more actions repeatedly Do-while control

structure—repeats as long as condition is true

Do-until control structure—repeats until condition is true

Page 46: Discovering Computers 2009

Step 2 — Design Solution

What is a program flowchart?

p. 690 Fig. 13-32 Next

Graphically shows logic in solution algorithm

Page 47: Discovering Computers 2009

Step 2 — Design Solution

What is an example of a flowchart?

p. 691 Fig. 13-33 Next

Page 48: Discovering Computers 2009

Step 2 — Design Solution

What is flowcharting software?

p. 690 - 691 Fig. 13-34 Next

Used by programmers to develop flowcharts

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

Page 49: Discovering Computers 2009

Step 2 — Design Solution

What is pseudocode?

p. 690 and 692 Fig. 13-35 Next

Uses condensed form of English to convey program logic

Page 50: Discovering Computers 2009

Step 3 — Validate Design

What is involved in validating the design?

p. 693 Next

Check program design for accuracy

Logic errorLogic errordesign flaw that causes

inaccurate results

Test dataTest datasample data that

mimics real data that program will process

Programmer checks logic for correctness

and attempts to uncover logic errors

Desk checkDesk checkprogrammers use test

data to step through logic

Inspectionsystems analyst reviews

deliverables during the system development cycle

Page 51: Discovering Computers 2009

Step 4 — Implement Design

What is implementation?

p. 693 - 694 Fig. 13-38 Next

Writing the code that translates the design into a program Syntax—rules that specify how to write instructions Comments—program documentation

Extreme programming (XP)—coding and testing as soon as requirements are defined

Page 52: Discovering Computers 2009

Step 5 — Test Solution

What is involved in testing the solution?

p. 695 - 696 Next

Ensure program runs correctly Ensure program runs correctly and is error freeand is error free

DebuggingDebugging—locating and —locating and correcting syntax and logic correcting syntax and logic

errors, orerrors, or bugsbugs

Test copy of program, Test copy of program, called called betabeta, sometimes , sometimes

used to find bugsused to find bugs

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

Page 53: Discovering Computers 2009

Step 6 — Document Solution

What is involved in documenting the solution?

p. 696 Next

Programmer performs two activities

Reviews program code—removes dead code, program instructions that program never

executes

Reviews program code—removes dead code, program instructions that program never

executesReviews

documentation

Reviews documentation

Page 54: Discovering Computers 2009

Summary of Programming Languages and Program Development

Various programming languages used to create

computer programs

Various programming languages used to create

computer programs

The program development cycle and the tools used to make

this process efficient

The program development cycle and the tools used to make

this process efficient

Web development and multimedia development tools

Web development and multimedia development tools

Chapter 13 Complete