YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: Computer Programs and Programming Languages

1Computer Programs and Programming Languages

What is a computer program? Set of instructions that directs computer to perform

tasks Programming language—used to write instructions

Page 2: Computer Programs and Programming Languages

2Computer Programs and Programming Languages

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

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-independent

can run on many different types of computers

Often machine-independentcan run on many different

types of computersMachine and assembly languages

are low-level

Machine and assembly languages are low-level

Page 3: Computer Programs and Programming Languages

3Low-Level Languages

What is machine language? Only language computer

directly recognizes

Page 4: Computer Programs and Programming Languages

4Low-Level Languages

What is assembly language? Instructions made up of

symbolic instruction codes, meaningful abbreviations and codes

Source program contains code to be converted to machine language

Page 5: Computer Programs and Programming Languages

5Procedural Languages

What is a procedural language?

Most widely used are BASIC, COBOL, and C

Uses series of English-like words to write instructions

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

Programmer writes instructions that tell

computer what to accomplish and how to do it

Page 6: Computer Programs and Programming Languages

6Procedural Languages

What is a compiler? Program that

converts entire source program into machine language before executing it

Page 7: Computer Programs and Programming Languages

7Procedural Languages

What is an interpreter? Program that

translates and executes one program code statement at a time

Does not produce object program

Page 8: Computer Programs and Programming Languages

8Procedural Languages

What is BASIC? Designed for use as simple, interactive problem-solving

language Beginner’s All-purpose Symbolic Instruction Code

Page 9: Computer Programs and Programming Languages

9Procedural Languages

What is COBOL? Designed for business applications English-like statements make code easy to read, write,

and maintain COmmon

Business-Oriented Language

Page 10: Computer Programs and Programming Languages

10Procedural Languages

What is C? Powerful language originally designed to write system

software Requires professional programming skills

Page 11: Computer Programs and Programming Languages

11Object-Oriented Programming Languages

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

Used to implement

object-oriented design

Major benefit is ability to

reuse existing objects

Event-driven—checks for

and responds to set of events

C++ and Java are complete

object-oriented languages

Object is item that contains data and

procedures that act on

data

Event is action to

which program responds

Page 12: Computer Programs and Programming Languages

12Object-Oriented Programming Languages

What is C++? Includes all elements of C, plus additional features

for working with object-oriented concepts Used to develop

database and Web applications

Page 13: Computer Programs and Programming Languages

13Object-Oriented Programming Languages

What is Java? Developed by Sun

Microsystems Similar to C++ but

uses just-in-time (JIT) compiler to convert source code into machine code

Page 14: Computer Programs and Programming Languages

14Object-Oriented Programming Languages

What is a visual programming language?

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

Sometimes calledSometimes calledfifth-generation fifth-generation

languagelanguage

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

Page 15: Computer Programs and Programming Languages

15Object-Oriented Programming Languages

What is Visual Studio 2005? Suite of visual programming languages and RAD tools .NET is set of technologies that allows program to run on Internet Visual Basic 2005 is used to build complex object-based programs

Step 1. The programmer designs the user interface.

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

Step 4. The programmer tests the application.

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

Page 16: Computer Programs and Programming Languages

16Object-Oriented Programming Languages

What is Delphi? Powerful visual programming tool Ideal for large-scale enterprise and Web applications

Page 17: Computer Programs and Programming Languages

17Object-Oriented Programming Languages

What is PowerBuilder? Another powerful visual programming tool Best suited for Web-based and large-scale

object-oriented applications

Page 18: Computer Programs and Programming Languages

18Nonprocedural Languages and Program Development Tools

What are nonprocedural languages and program development tools?

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 19: Computer Programs and Programming Languages

19Nonprocedural Languages and Program Development Tools

What is RPG (Report Program Generator)? Nonprocedural language used for generating reports,

performing computations, and updating files

Page 20: Computer Programs and Programming Languages

20Nonprocedural Languages and Program Development Tools

What is a fourth-generation language (4GL)? 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 21: Computer Programs and Programming Languages

21Nonprocedural Languages and Program Development Tools

What is an application generator? 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 22: Computer Programs and Programming Languages

22Nonprocedural Languages and Program Development Tools

What is Visual Basic for Applications (VBA)? Macro programming language

Macro—series of statements used to automate tasks

Page 23: Computer Programs and Programming Languages

23Web Page Development

What is HTML (Hypertext Markup Language)? Used to create Web pages

Page 24: Computer Programs and Programming Languages

24Web Page Development

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

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

Processing Processing formform

collects data from visitors to Web site

ServletServletapplet that

runs on server

ActiveX ActiveX controlcontrol

small program that runs on

client

Page 25: Computer Programs and Programming Languages

25Web Page Development

What is the common gateway interface (CGI)? Communications standard that defines how Web server

communicates with outside sources

Step 3. When the user submits a request, it is sent to the CGI program. The CGI program contacts the database and requests information for the user. In this case, it looks for a movie titled The Wizard of Oz.

Step 1. The programmer stores the CGI program in a special folder on the Web server such as /cgi-bin.

Database

CGI script—program that manages sending and receiving across CGI

Step 2. The Webmaster creates a link between the CGI program and Web page. When a user displays the Web page, the CGI program automatically starts.

Step 4. The CGI program receives information from the database, assembles it in an HTML format, and sends it to the user’s Web browser.

Page 26: Computer Programs and Programming Languages

26Web Page Development

What is a scripting language? Typically easy to learn and use

JavaScript—adds dynamic content and interactive elements to Web page

VBScript (Visual Basic, Scripting Edition)—adds intelligence and interactivity to Web page

Perl (Practical Extraction and Report Language)—has powerful text processing capabilities

Page 27: Computer Programs and Programming Languages

27Web Page Development

What is dynamic HTML (DHTML)? Allows developers to

include more graphical interest and interactivity in Web page

Page 28: Computer Programs and Programming Languages

28Web Page Development

What are XHTML, XML, and WML?

XHTML (Extensible HTML)

enables Web sites to be displayed more easily on microbrowsers

XML (Extensible Markup Language)

allows developers to create customized tags

WML (Wireless Markup Language)

allows developers to design pages specifically for microbrowsers

Includes features of HTML and XML

Uses wireless application protocol (WAP),

standard that specifies how wireless devices

communicate with Web

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

going back to server

Page 29: Computer Programs and Programming Languages

29

FrontPageFrontPage20032003

FlashFlashMXMX

Web Page Development

What is Web page authoring software? Creates sophisticated Web pages without using HTML Generates HTML

DreamweaverDreamweaverMXMX

Page 30: Computer Programs and Programming Languages

30Multimedia Program DevelopmentWhat is multimedia authoring software? Combines text,

graphics, animation, audio, and video into interactive presentation

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

Software includes Toolbook, Authorware, and Director

Page 31: Computer Programs and Programming Languages

31Other Programming Languages

What are other available programming languages?

ALGOLALGOLALGOLALGOLADAADAADAADA APLAPLAPLAPL

FORTHFORTHFORTHFORTH LISPLISPLISPLISPHYPERTALKHYPERTALKHYPERTALKHYPERTALKFORTRANFORTRANFORTRANFORTRAN

LOGOLOGOLOGOLOGO PASCALPASCALPASCALPASCALMODULA-2MODULA-2MODULA-2MODULA-2

PILOTPILOTPILOTPILOT SMALLTALKSMALLTALKSMALLTALKSMALLTALKPROLOGPROLOGPROLOGPROLOGPL/IPL/IPL/IPL/I

Page 32: Computer Programs and Programming Languages

32The Program Development Cycle

What is the program development cycle? Steps programmers use to build computer programs

Programming team—Group of programmers working on program

Page 33: Computer Programs and Programming Languages

33Step 1 — Analyze Requirements

What is involved in analyzing the requirements?1. Review requirements2. Meet with systems analyst and users3. Identify input, output, processing, and data

components IPO chart—

Identifies program’s inputs, outputs, and processing steps

Page 34: Computer Programs and Programming Languages

34

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?

Object-oriented Object-oriented designdesign

Structured Structured designdesign, sometimes , sometimes

called called top-down designtop-down design

Two Two approachesapproaches

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

Page 35: Computer Programs and Programming Languages

35Step 2 — Design Solution

What is a hierarchy chart? Shows program modules graphically Also called structure chart

Page 36: Computer Programs and Programming Languages

36Step 2 — Design Solution

What is object-oriented (OO) design? Programmer packages data and

procedure into single unit, an object Objects are grouped into classes Class diagram represents hierarchical

relationships of classes graphically

Page 37: Computer Programs and Programming Languages

37Step 2 — Design Solution

What is a sequence control structure? Control structure that shows actions following each

other in order Control structure depicts logical order of program

instructions

Page 38: Computer Programs and Programming Languages

38Step 2 — Design Solution

What is a selection control structure? 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 39: Computer Programs and Programming Languages

39Step 2 — Design Solution

What is a case control structure? Yields one of three or more possibilities

Page 40: Computer Programs and Programming Languages

40Step 2 — Design Solution

What is a repetition control structure? 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

Do-While Control Structure Do-Until Control Structure

Page 41: Computer Programs and Programming Languages

41Step 2 — Design Solution

What is a program flowchart? Graphically shows logic

in solution algorithm

Page 42: Computer Programs and Programming Languages

42Step 2 — Design Solution

What is an example of a flowchart?

Page 43: Computer Programs and Programming Languages

43Step 2 — Design Solution

What is flowcharting software? Used by programmers to develop flowcharts

Page 44: Computer Programs and Programming Languages

44Step 2 — Design Solution

What is pseudocode? Uses condensed form

of English to convey program logic

Page 45: Computer Programs and Programming Languages

45Step 3 — Validate Design

What is involved in validating the design?

Check program design for accuracy

Logic errordesign flaw that causes

inaccurate results

Test datasample data that

mimics real data that program will process

Programmer checks logic for correctness

and attempts to uncover logic errors

Desk checkprogrammers use test

data to step through logic

Structured walkthroughprogrammer explains

logic of algorithm while programming team steps through program logic

Page 46: Computer Programs and Programming Languages

46Step 4 — Implement Design

What is implementation? 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 47: Computer Programs and Programming Languages

47Step 5 — Test Solution

What is involved in testing the solution?

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

Page 48: Computer Programs and Programming Languages

48Step 6 — Document Solution

What is involved in documenting the solution? 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


Related Documents