Discovering Computers 2008

advertisement

Discovering Computers 2008

Chapter 13

Programming

Languages and

Program Development

Applications vs. Program Languages

User Oriented CPU Oriented

Program Language vs. Application

Procedural Non-Procedural

Program Language vs. Application

You

Communicate

CPU

Application

Computer Programs and Programming Languages

What is a computer program ?

Series of instructions that tells CPU what to do known as “perform tasks”

Created by a programmer using a programming language p. 664 Fig. 13-1

Next

Procedural Languages

What is debugging ?

Process of locating and correcting syntax and logic errors in program

Harvard University,

September 9, 1945

Why Program ??????

Communicate with programmer on the job

Customize software

Increase computer understanding

Increase software understanding

Promotion within the company

Challenging and Fun

Computer Programming Video

Computer Programs and Programming Languages

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

High-level language

Low-level language

Machine and assembly languages are low-level

Machine-dependent runs only on one type of computer p. 664

Next

Low-Level Languages

What is machine language ?

 Only language computer directly recognizes

 Uses a series of binary digits (1s and 0s) with a combination of numbers and letters that represent binary digits

A dump p. 665 Fig. 13-2

Next

Low-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 p. 666 Fig. 13-3

Next

Computer Programs and Programming Languages

What are high-level languages?

High-level language

Often machine-independent can run on many different types of computers and operating systems p. 665

Next

Procedural Languages

What is a procedural language ?

Programmer writes instructions that tell computer what to accomplish and how to do it

Uses series of English-like words to write instructions

BASIC,

COBOL, and C

Next

Procedural Languages

What is COBOL ?

Designed for business applications

English-like statements make code easy to read, write, and maintain

COmmon Business-Oriented Language p. 668

Procedural Languages

What is C ?

Powerful language originally designed to write operating system software

Requires professional programming skills

} for(int b = 0; b < 1; b++)

{ outp(PortAddr, 50); while((inp(PortAddr + 5) &

} for(int c = 0; c < 1; c++)

{

0x020) == 0); outp(PortAddr, 32); while((inp(PortAddr + 5) & 0x020) == 0);

} p. 668

Object-Oriented Programming Languages

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

Used to implement object-oriented design

Object is item that contains data and procedures that act on data

Major benefit is ability to reuse existing objects

Event-driven— checks for and responds to set of events

Java, C++, C#, and Visual Basic are complete object-oriented languages

Event is action to which program responds p. 669

Next

Object-Oriented Programming Languages

What is Java ?

 Developed by Sun

Microsystems

 Similar to C++

 Used to develop

Web applications

Click to view Web

Link, click Chapter 13, Click

Web Link from left navigation, then click

Java below Chapter 13 p. 669 Fig. 13-8

Next

Object-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 games because of its speed; applications; operating systems

Click to view Web

Link, click Chapter 13, Click

Web Link from left navigation, then click

C++ below Chapter 13 p. 670 Fig. 13-9

Next

Object-Oriented Programming Languages

What is C# ?

 Object-oriented programming language based on C++

 Accepted as a standard for Web applications and

XML-based Web services

Click to view Web

Link, click Chapter 13, Click

Web Link from left navigation, then click

C# below Chapter 13 p. 670

Next

Other Programming Languages and Development Tools

A 4GL (fourth-generation language) is a nonprocedural language that enables users and programmers to access data in a database

Structured

Query

Language

Portland.accdb

Other Programming Languages and Development Tools

Classic programming languages include:

Ada ALGOL APL BASIC

Forth FORTRAN HyperTalk LISP

Logo

PL/1

Modula-2 Pascal

Prolog RPG

PILOT

Smalltalk

Other Program Development Tools

What is a macro ?

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

Prevents creating the same task over and over again

How to create a simple macro in

Microsof Excel p. 676 - 677 Fig. 13-17

Next

Web Page Development

What is HTML (Hypertext Markup Language)?

 Used to create Web pages

Click to view Web

Link, click Chapter 13, Click

Web Link from left navigation, then click

HTML below Chapter 13 p. 678 Fig. 13-18

Next

Web Page Development

What is the common gateway interface (CGI)?

 Communications standard that defines how Web server communicates with outside sources

CGI script

—program that manages sending and receiving across CGI http://www.harrietcarter.com/ p.679 - 680 Fig. 13-19

Web Page Development

What is a scripting language?

Typically easy to learn and use

JavaScript

 Perl (Practical Extraction and Report Language)

 PHP (PHP: Hypertext

Preprocessor)

 VBScript (Visual Basic,

Scripting Edition)

COD Script p. 680 - 681 Fig. 13-20

Next

Web Page Development

What is Web page authoring software ?

Creates sophisticated Web pages without using HTML

Generates HTML

Dreamweaver Expression

Web

Flash p. 683

Next

Web Page Development

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

Share personal information

Allow users to modify Web site content

Have application software built into the site

Web Page Development

Most Web 2.0 sites use

APIs Application Programming Interfaces

An API enables programmers to interact with an environment such as a Web site or operating system

Multimedia Program Development

What is multimedia authoring software ?

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

Used for computerbased training (CBT) and Web-based training

(WBT)

 Software includes

Toolbook , Authorware , and Director

Multimedia Presentation p. 684 Fig. 13-22

The Program Development Cycle

What is the program development cycle ?

Steps programmers use to build computer programs

Programming team

—Group of programmers working on program p. 685 - 686 Fig. 13-23

Scientific Method?

Next

Structured Programming

Starting in the 1960s, a number of techniques evolved to make program design more systematic and programs themselves easier to read and maintain.

This type of design became known as structured programming.

Avoid GOTO Statements

Step 1 — Analyze Requirements

What is involved in analyzing the requirements?

1.

Review requirements

2.

Meet with systems analyst and users

3.

Identify input, output, processing, and data components

 IPO chart—

Identifies program’s inputs, outputs, and processing steps p. 686 Fig. 13-24

Next

Design Solution

The design of the program addresses all of the tasks the program must perform and how to organize or sequence them when coding the program.

Design tools to plan the solution include:

 Pseudocode

 Flowcharts

 Structure

Charts

Step 2 — Design Solution

What is pseudocode?

 Uses condensed form of English to convey program logic p. 690 and 692 Fig. 13-35

Next

Design Solution - Pseudocode

Step 2 — Design Solution

What is a program flowchart?

 Graphically shows logic in solution algorithm p. 690 Fig. 13-32

Next

Step 2 — Design Solution

What is flowcharting software ?

 Used by programmers to develop flowcharts

Click to view Web

Link, click Chapter 13, Click

Web Link from left navigation, then click

Flowcharting Software below Chapter 13 p. 690 - 691 Fig. 13-34

Next

Hierarchy Chart

Hierarchy charts depict the overall organization of a program.

Program modules should be arranged hierarchically, in a top-down design.

Step 2 — Design Solution

What is a hierarchy chart ?

Shows program modules graphically

Also called structure chart p. 687 Fig. 13-25

Next

Step 2 – Design Solution

What is structured design?

Technique that builds all program logic from combination of three basic control structures sequence control structure repetition control structure selection control structure

Step 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 p. 688 Fig. 13-27

Next

Step 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 p. 689 Fig. 13-28

Next

Step 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 as long as the condition is false p. 689 - 690 Figs. 13-30–13-31

Next

Step 3 — Validate Design

What is involved in validating the design?

Check program design for accuracy

Desk check programmers use test data to step through logic

Test data sample data that mimics real data that program will process

Programmer checks logic for correctness and attempts to uncover logic errors

Logic error design flaw that causes inaccurate results

Inspection systems analyst reviews deliverables during the system development cycle p. 693

Next

Step 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 p. 693 - 694 Fig. 13-38

Next

Step 5 — Test Solution

Ensure program runs correctly and is error free

Logic

Error

Design

Code

Debug

Syntax

Error

Debugging is the process of making sure a program is free of errors, or “bugs”.

Logic errors

Syntax errors

Testing insures that the programs work as planned.

Alpha testing

Beta testing

Document

Step 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 documentation p. 696

Next

Summary of Programming Languages and Program Development

Various programming languages used to write and develop computer programs

The program development cycle and the tools used to make this process efficient

Web development and multimedia development tools

Chapter 13 Complete

Download