Chapter 13 Programming Languages and Program
Development
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 software Differentiate between machine
and assembly languages Differentiate between machine
and assembly languages
Identify and discuss the purpose of procedural programming languages Identify and discuss the purpose of procedural programming languages
Discuss the advantages and uses of visual programming languages Discuss the advantages and uses of
visual programming languages
Identify and discuss the characteristics of object-oriented programming languages Identify and discuss the characteristics of object-oriented programming languages
Identify the uses of various nonprocedural languages and tools Identify the uses of various nonprocedural
languages and 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 used in designing solutions to programming problems Explain the basic control structures used in designing solutions to programming problems
Computer Programs and Programming Languages What is a computer program?
p. 664 Fig. 13-1 Next
Ø Set of instructions that directs computer to perform tasks
§ Programming language— used to write instructions
Click to view video Click to view animation
Computer Programs and Programming Languages What are low-level languages and high-level languages?
p. 664 Next
High-level language High-level language Low-level
language Low-level
language
Machine-dependent runs only on one type of computer
Machine-dependent
runs only on one type of computer Often machine-independent can run on many different
types of computers Often machine-independent
can run on many different types of computers Machine and assembly languages
are low-level Machine and assembly languages
are low-level
Low-Level Languages
What is machine language?
p. 665 Fig. 13-2 Next
Ø Only language computer directly recognizes
Click to view animation
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
Procedural Languages
What is a procedural language?
p. 666 Next
Most widely used are BASIC, COBOL, and C Uses series of English-like words to write instructions
Often called third third- -generation generation language (3GL) language (3GL) Programmer writes instructions that tell computer what to accomplish
and how to do it
Click to view animation
Procedural Languages
What is a compiler?
p. 667 Fig. 13-4 Next
Ø Program that converts entire source program into machine language before executing it
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
Procedural Languages
What is BASIC?
p. 668 Fig. 13-6 Next
Ø Designed for use as simple, interactive problem-solving language
Ø Beginner’s All-purpose Symbolic Instruction Code
Procedural Languages
What is COBOL?
p. 668 Fig. 13-7 Next
Click to view Web Link, click Chapter 13, Click Web Link from left navigation, then click COBOL below Chapter 13
Ø Designed for business applications
Ø English-like statements make code easy to read, write, and maintain
Ø COmmon
Business-Oriented Language
Procedural Languages
What is C?
p. 669 Fig. 13-8 Next
Ø Powerful language originally designed to write system software
Ø Requires professional programming skills
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 existing
objects
Event-driven—
checks for and responds to set of events
C++ and Java are complete object-oriented
languages
Objectisitem that contains data and procedures that act on data
Eventis action to which program responds
Object-Oriented Programming Languages
What is C++?
p. 670 Fig. 13-9 Next
Click to view Web Link, click Chapter 13, Click Web Link from left navigation, then click C++ below Chapter 13
Ø Includes all elements of C, plus additional features for working with object-oriented concepts Ø Used to develop
database and Web applications
Object-Oriented Programming Languages
What is Java?
p. 670 Fig. 13-10 Next
Click to view Web Link, click Chapter 13, Click Web Link from left navigation, then click Java below Chapter 13
Ø Developed by Sun Microsystems Ø Similar to C++ but
uses just-in-time (JIT) compiler to convert source code into machine code
Click to view video
Object-Oriented Programming Languages
What is a visual programming language?
p. 671 Next
Click to view Web Link, click Chapter 13, Click Web Link from left navigation, then click RAD below Chapter 13
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) environment environment
Sometimes called Sometimes called fifth
fifth- -generation language generation language Provides visual or Provides visual or graphical interface for graphical interface for creating source code creating source code
Object-Oriented Programming Languages
What is Visual Studio .NET 2003?
p. 672 Fig. 13-11 Next
Click to view Web Link, click Chapter 13, Click Web Link from left navigation, then click Visual Studio .NET 2003 below Chapter 13
Ø
Suite of visual programming languages and RAD tools
Ø.NET is set of technologies that allows program to run on Interne t
Ø Visual Basic .NET 2003is used to build complex object-based programs
Step 1. Theprogrammer designs the user interface.
Step 2.The programmer assigns properties to each object on the form.
Step 4.The programmer
Step 3.The programmer writes code to define the action of each command button.
Object-Oriented Programming Languages
What is Delphi?
p. 673 Fig. 13-12 Next
Ø Powerful visual programming tool
Ø Ideal for large-scale enterprise and Web applications
Object-Oriented Programming Languages
What is PowerBuilder?
p. 674 Fig. 13-13 Next
Ø Another powerful visual programming tool Ø Best suited for Web-based and large-scale
object-oriented applications
Nonprocedural Languages and Program Development Tools
Ø What are nonprocedural languages and program development tools?
p. 674 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
Nonprocedural Languages and Program Development Tools
What is RPG (Report Program Generator)?
p. 674 Fig. 13-14 Next
Ø Nonprocedural language used for generating reports, performing computations, and updating files
Nonprocedural Languages and Program Development Tools
What is a fourth-generation language (4GL)?
p. 675 Fig. 13-15 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
Nonprocedural Languages and Program Development Tools What is an application generator?
p. 675 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
Nonprocedural Languages and Program Development Tools
What is Visual Basic for Applications (VBA)?
p. 676 Fig. 13-17 Next
Click to view Web Link, click Chapter 13, Click Web Link from left navigation, then click Macros below Chapter 13
Ø Macro programming language
§ Macro— series of statements used to automate tasks
Web Page Development
What is HTML (Hypertext Markup Language)?
p. 678 Fig. 13-18 Next
Click to view Web Link, click Chapter 13, Click Web Link from left navigation, then click HTML below Chapter 13
Ø Used to create Web pages
Web Page Development
How are special effects and interactive elements added to a Web page?
p. 679 Next
Counter Counter tracks number of visitors to
Web site
Image map Image map graphic image that
points to URL Script
Script interpreted program that runs on client
Applet Applet usually runs on client, but is compiled
Processing Processing form form collects data from visitors
to Web site Servlet Servlet applet that
runs on server
ActiveX ActiveX control control small program
that runs on client
Web Page Development
What is the common gateway interface (CGI)?
p. 680 Fig. 3-19 Next
Ø
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.
Web Page Development
What is a scripting language?
p. 681 Fig. 13-20 Next
Click to view Web Link, click Chapter 13, Click Web Link from left navigation, then click Scripting Languages below Chapter 13
Ø 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
Web Page Development
What is dynamic HTML (DHTML)?
p. 682 Fig. 13-21 Next
Ø Allows developers to include more graphical interest and interactivity in Web page
Web Page Development
What are XHTML, XML, and WML?
p. 682 Next
Click to view Web Link, click Chapter 13, Click Web Link from left navigation, then click XML below Chapter 13
XHTML (Extensible HTML)
enables Web sites to be displayedmore easily on microbrowsers
XML
(Extensible Markup Language)
allows developers to create customized tagsWML
(Wireless Markup Language)
allows developers to design pagesspecifically for microbrowsers
Includes features of HTML and XML
Useswireless 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
FrontPage
FrontPage2003
2003Flash
Flash
MX
MXWeb Page Development
What is Web page authoring software?
p. 683 Next
Ø Creates sophisticated Web pages without using HTML Ø Generates HTML
Dreamweaver
DreamweaverMX
MXMultimedia Program Development
What 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, Authorware, and Director
Other Programming Languages
What are other available programming languages?
p. 685 Next
ALGOL ALGOL ALGOL ADA ADA
ADA APL APL APL
FORTH FORTH
FORTH FORTRAN FORTRAN FORTRAN HYPERTALK HYPERTALK HYPERTALK LISP LISP LISP
LOGO LOGO
LOGO MODULA MODULA- MODULA-2 -2 2 PASCAL PASCAL PASCAL
PILOT PILOT
PILOT PL/I PL/I PL/I PROLOG PROLOG PROLOG SMALLTALK SMALLTALK SMALLTALK
The Program Development Cycle
What is the program development cycle?
p. 686 Fig. 13-24 Next
Ø Steps programmers use to build computer programs
§ Programming team— Group of programmers working on program
Step 1 — Analyze Requirements
What is involved in analyzing the requirements?
p. 687 Fig. 13-25 Next
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
Programmer Programmer begins with general begins with general design and moves toward design and moves toward
detailed design detailed design
Step 2 — Design Solution
What is involved in designing the solution?
p. 688 Next
Object Object--oriented oriented
design design
Structured Structured design design, sometimes , sometimes called
called toptop--down designdown design
Two
Two approaches approaches Devise
Devise
solution
solution
algorithm
algorithm, ,
step
step- -by by- -step step
procedure to
procedure to
solve problem
solve problem
Step 2 — Design Solution
What is a hierarchy chart?
p. 688 Fig. 13-26 Next
Ø Shows program modules graphically Ø Also called structure chart
Step 2 — Design Solution
What is object-oriented (OO) design?
p. 689 Fig. 13-27 Next
Click to view Web Link, click Chapter 13, Click Web Link from left navigation, then click Object-Oriented Design below Chapter 13
Ø Programmer packages data and procedure into single unit, an object
§ Objects are grouped into classes
§ Class diagram represents hierarchical relationships of classes graphically
Step 2 — Design Solution
What is a sequence control structure?
p. 690 Fig. 13-28 Next
Ø Control structure that shows actions following each other in order
§ Control structure depicts logical order of program instructions
Step 2 — Design Solution
What is a selection control structure?
p. 690 Fig. 13-29 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
Step 2 — Design Solution
What is a case control structure?
p. 690 Fig. 13-30 Next
Ø Yields one of three or more possibilities
Step 2 — Design Solution
What is a repetition control structure?
p. 691 Figs. 13-31–13- 32 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
Do -While Control Structure Do -Until Control Structure
Step 2 — Design Solution
What is a program flowchart?
p. 692 Fig. 13-33 Next
Ø Graphically shows logic in solution algorithm
Step 2 — Design Solution
What is an example of a flowchart?
p. 692 Fig. 13-34 Next
Step 2 — Design Solution
What is flowcharting software?
p. 692 Fig. 13-35 Next
Click to view Web Link, click Chapter 13, Click Web Link from left navigation, then click Flowcharting Software below Chapter 13
Ø Used by programmers to develop flowcharts
Step 2 — Design Solution
What is pseudocode?
p. 694 Fig. 13-36 Next
Ø Uses condensed form of English to convey program logic
Step 3 — Validate Design
What is involved in validating the design?
p. 694 Next
Check program design for accuracy
Logic error design flaw that causes inaccurate results
Test data sample data that mimics real data that program will process
Programmer checks logic for correctness and attempts to uncover
logic errors
Desk check programmers use test data to step through logic
Structured walkthrough programmer explains logic of algorithm while programming team steps
through program logic
Step 4 — Implement Design
What is implementation?
p. 695 Fig. 13-37 Next
Click to view Web Link, click Chapter 13, Click Web Link from left navigation, then click Extreme Programming below Chapter 13
Ø
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
Step 5 — Test Solution
What is involved in testing the solution?
p. 696 Next
Ensure program runs correctly Ensure program runs correctly
and is error free and is error free
Debugging
Debugging— — locating and locating and correcting syntax and logic correcting syntax and logic
errors, or errors, or bugs bugs
Test copy of program, Test copy of program, calledcalled betabeta, sometimes , sometimes used to find bugs used to find bugs
Step 6 — Document Solution
What is involved in documenting the solution?
p. 698 Next