Upload
yhal-htet-aung
View
421
Download
0
Embed Size (px)
DESCRIPTION
ပရိုဂရမ်မင်းဘာသာများနှင့်ပရိုဂရမ်တီထွင်မှု
Citation preview
Discovering Computers 2008
Chapter 11 Chapter 11 Chapter 11 Chapter 11
Programming Programming Programming Programming
Languages and Languages and Languages and Languages and
Program DevelopmentProgram DevelopmentProgram DevelopmentProgram Development
2
Chapter 10 ObjectivesChapter 10 ObjectivesChapter 10 ObjectivesChapter 10 Objectives
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 languages
Differentiate between machine and assembly languages
Identify and discuss the purpose of procedural programming languagesIdentify and discuss the purpose of procedural programming languages
Identify the uses of popular multimedia authoring programs
Identify the uses of popular multimedia authoring programs
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
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
3
Computer Programs and Programming LanguagesComputer Programs and Programming LanguagesComputer Programs and Programming LanguagesComputer Programs and Programming Languages
What is a computer program?� Series of instructions that directs computer to
perform tasks� Programming language— used to communicate
instructions
4
Computer Programs and Programming LanguagesComputer Programs and Programming LanguagesComputer Programs and Programming LanguagesComputer Programs and Programming Languages
What are low-level languages and high-level languages?
High-level language
High-level language
Low-levellanguageLow-levellanguage
Machine-dependentMachine-dependent Often machine-Often machine-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 and
operating systems
Often machine-independent
can run on many different types of computers and
operating systemsMachine and assembly languagesare low-levelMachine and assembly languagesare low-level
5
LowLowLowLow----Level LanguagesLevel LanguagesLevel LanguagesLevel Languages
What is machine language?� Only language computer
directly recognizes� Uses a series of binary
digits (1s and 0s)with a combination of numbers combination of numbers and lettersthat represent binary digits
6
LowLowLowLow----Level LanguagesLevel LanguagesLevel LanguagesLevel Languages
What is assembly language?� Instructions made up of
symbolic instruction codes, meaningful abbreviations and codes
� Source programcontains � Source programcontains code to be converted to machine language
7
Procedural LanguagesProcedural LanguagesProcedural LanguagesProcedural Languages
What is a procedural language?
Uses series of English-like words to write instructions
Programmer writes instructions that tell computer what to
accomplish and how to do it
Often called thirdthird--generation language generation language
(3GL)(3GL)
accomplish and how to do it
8
Procedural LanguagesProcedural LanguagesProcedural LanguagesProcedural Languages
What is a compiler?� Program that
converts entire source program into machine machine languagebefore executing it
9
Procedural LanguagesProcedural LanguagesProcedural LanguagesProcedural Languages
What is an interpreter ?� Program that
translates and executesone program statement (code) at (code) at a time
� Does not produce object program
10
Procedural LanguagesProcedural LanguagesProcedural LanguagesProcedural Languages
What is COBOL?� Designed for business applications� English-like statements make code easy to read, write,
and maintain� COmmon Business-Oriented Language
11
Procedural LanguagesProcedural LanguagesProcedural LanguagesProcedural Languages
What is C?� Powerful language originally designed to write system
software� Requires professional programming skills
COBOL
C
12
ObjectObjectObjectObject----Oriented Programming LanguagesOriented Programming LanguagesOriented Programming LanguagesOriented 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
Java, C++, C#, and Visual Basic
are complete object-oriented
languageslanguagesObject is item that contains data and
proceduresthat act on data
Event is action to which program responds
13
ObjectObjectObjectObject----Oriented Programming LanguagesOriented Programming LanguagesOriented Programming LanguagesOriented Programming Languages
What is Java?� Developed by Sun
Microsystems� Similar to C++ but
uses just-in-time (JIT) compiler to (JIT) compiler to convert source code into machine code
14
ObjectObjectObjectObject----Oriented Programming LanguagesOriented Programming LanguagesOriented Programming LanguagesOriented 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 applicationsWeb applications
15
ObjectObjectObjectObject----Oriented Programming LanguagesOriented Programming LanguagesOriented Programming LanguagesOriented Programming Languages
What is C#?� 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 � Resulting code is called Microsoft Intermediate
Language (MSIL)
16
ObjectObjectObjectObject----Oriented Programming LanguagesOriented Programming LanguagesOriented Programming LanguagesOriented Programming Languages
What is a visual programming language?
Visual programming environment (VPE)allows developers to
drag and drop objects to build programs
Provides Provides visual or visual or graphical interfacegraphical interface for for creating source codecreating source code
Programmer writes and implements program in segments
to build programs
Often used in Often used in RAD RAD (rapid application (rapid application
development)development)environmentenvironment
Sometimes calledSometimes calledfifthfifth--generation generation
languagelanguage
17
ObjectObjectObjectObject----Oriented Programming LanguagesOriented Programming LanguagesOriented Programming LanguagesOriented Programming Languages
What is VisualStudio?� .NET is set of technologies that allows program to run on Internet� Comprised ofVisual Basic, Visual C++, Visual C#, and Visual J#
Step 1. The developer designs the user interface.
Step 2. The developer assigns properties to each object on the form.
user interface.
Step 3. The developerwrites code to define the action of each command button.
Step 4. The developer tests the program.
18
ObjectObjectObjectObject----Oriented Programming LanguagesOriented Programming LanguagesOriented Programming LanguagesOriented Programming Languages
What is Delphi?� Powerful visual programming tool� Ideal for large-scale enterprise and Web applications
19
ObjectObjectObjectObject----Oriented Programming LanguagesOriented Programming LanguagesOriented Programming LanguagesOriented Programming Languages
What is PowerBuilder?� Another powerful visual programming tool� Best suited for Web-based and large-scale
enterprise object-oriented applications
20
Other Programming LanguagesOther Programming LanguagesOther Programming LanguagesOther Programming Languages
� What are nonprocedural languagesand program development tools?
Nonprocedural Language
The programmer writes English-
Nonprocedural Language
The programmer writes English-
Program Development Tools
User-friendly programs
Program Development Tools
User-friendly programs The programmer writes English-like instructions or interacts with a visual environment to retrieve
data from files or a database
The programmer writes English-like instructions or interacts with a visual environment to retrieve
data from files or a database
User-friendly programs designed to assist both
programmers and users in creating programs
User-friendly programs designed to assist both
programmers and users in creating programs
21
Other Programming LanguagesOther Programming LanguagesOther Programming LanguagesOther Programming Languages
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
22
Other Program Development ToolsOther Program Development ToolsOther Program Development ToolsOther 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
23
Web Page DevelopmentWeb Page DevelopmentWeb Page DevelopmentWeb Page Development
What is HTML (Hypertext Markup Language)?� Used to create Web pages
24
Web Page DevelopmentWeb Page DevelopmentWeb Page DevelopmentWeb 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 manages sending and receiving across CGI
25
Web Page DevelopmentWeb Page DevelopmentWeb Page DevelopmentWeb Page Development
What is dynamic HTML (DHTML) ?� Allows developers to
include more graphical interest and interactivity in Web page
26
Web Page DevelopmentWeb Page DevelopmentWeb Page DevelopmentWeb Page Development
What are XHTML , XML , and WML ?
XHTML XHTML (Extensible HTML)
enables Web sites to be displayed more easily on microbrowsers
XML XML
Includes features of HTML and XML
XML XML (Extensible Markup Language)
allows developers to create customized tags
WMLWML(Wireless Markup Language)
allows developers to design pages specifically for microbrowsers
Many PDAs and smart phones use WML as their
markup language
Server sends entire record to client, enabling client to do much of processing without
going back to serverRSS 2.0
27
Web Page DevelopmentWeb Page DevelopmentWeb Page DevelopmentWeb Page Development
What is Web page authoring software?� Creates sophisticated Web pages without using HTML� Generates HTML
FlashFlashExpressionExpressionWebWeb
DreamweaverDreamweaver
28
Multimedia Program DevelopmentMultimedia Program DevelopmentMultimedia Program DevelopmentMultimedia Program Development
What is multimedia authoring software?� Combines text,
graphics, animation, audio, and video into interactive presentation
� Used for computer-Used for computer-based training (CBT) and Web-based training (WBT)
� Software includes Toolbook, Authorware, and Director
29
The Program Development CycleThe Program Development CycleThe Program Development CycleThe Program Development Cycle
What is the program development cycle?� Steps programmers use to build computer programs
� Programming team—Groupof programmers working on programprogram
30
Step 1 Step 1 Step 1 Step 1 ———— Analyze RequirementsAnalyze RequirementsAnalyze RequirementsAnalyze 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—� IPO chart—
Identifies program’s inputs, outputs, and processing steps
31
Step 2 Step 2 Step 2 Step 2 ———— Design SolutionDesign SolutionDesign SolutionDesign Solution
What is involved in designing the solution?
ObjectObject--oriented oriented designdesignTwo Two
approachesapproaches
Programmer Programmer begins with general begins with general
design and moves toward design and moves toward detailed designdetailed design
Structured Structured designdesign, sometimes , sometimes
called topcalled top--down designdown design
Devise Devise solution solution algorithm, algorithm, stepstep--byby--step step procedure to procedure to solve problemsolve problem
32
Step 2 Step 2 Step 2 Step 2 ———— Design SolutionDesign SolutionDesign SolutionDesign Solution
What is a hierarchy chart?� Shows program modules graphically� Also called structure chart
33
Step 2 Step 2 Step 2 Step 2 ———— Design SolutionDesign SolutionDesign SolutionDesign Solution
What is object-oriented (OO) design?� Programmer packages data and
procedure into single unit, an object� Objects are grouped into classes
� Class diagramrepresents hierarchical relationships of classes graphicallyrelationships of classes graphically
34
Step 2 Step 2 Step 2 Step 2 ———— Design SolutionDesign SolutionDesign SolutionDesign Solution
What is a sequence control structure?� Control structure that shows actions following each
other in order� Control structure depicts
logical order of program instructionsinstructions
35
Step 2 Step 2 Step 2 Step 2 ———— Design SolutionDesign SolutionDesign SolutionDesign Solution
What is a selection control structure?� Tells program which
action to take, based on a certain condition
� Two types� Two types� Case control structure
� If-then-else control structure—yields one of two possibilities: true or false
36
Step 2 Step 2 Step 2 Step 2 ———— Design SolutionDesign SolutionDesign SolutionDesign Solution
What is a case control structure?� Yields one of three or more possibilities
37
Step 2 Step 2 Step 2 Step 2 ———— Design SolutionDesign SolutionDesign SolutionDesign 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 truetrue
� Do-until control structure—repeats until condition is true
38
Step 2 Step 2 Step 2 Step 2 ———— Design SolutionDesign SolutionDesign SolutionDesign Solution
What is a program flowchart?� Graphically shows logic
in solution algorithm
39
Step 2 Step 2 Step 2 Step 2 ———— Design SolutionDesign SolutionDesign SolutionDesign Solution
What is an example of a flowchart?
40
Step 2 Step 2 Step 2 Step 2 ———— Design SolutionDesign SolutionDesign SolutionDesign Solution
What is flowcharting software?� Used by programmers to develop flowcharts
41
Step 2 Step 2 Step 2 Step 2 ———— Design SolutionDesign SolutionDesign SolutionDesign Solution
What is pseudocode?� Uses condensed form
of English to convey program logic
42
Step 3 Step 3 Step 3 Step 3 ———— Validate DesignValidate DesignValidate DesignValidate Design
What is involved in validating the design?
Check program design for accuracy
Logic errorLogic error
Programmer checks logic for correctness
and attempts to uncover logic errors
Logic errorLogic errordesign flaw that causes
inaccurate results
Test dataTest datasample data that
mimics real data that program will process
Desk checkDesk checkprogrammers use test
data to step through logic
Inspectionsystems analyst reviews
deliverables during the system development cycle
43
Step 4 Step 4 Step 4 Step 4 ———— Implement DesignImplement DesignImplement DesignImplement 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
44
Step 5 Step 5 Step 5 Step 5 ———— Test SolutionTest SolutionTest SolutionTest 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 bugsbugserrors, orerrors, or bugsbugs
Test copy of program, Test copy of program, called called betabeta, sometimes , sometimes
used to find bugsused to find bugs
45
Step 6 Step 6 Step 6 Step 6 ———— Document SolutionDocument SolutionDocument SolutionDocument Solution
What is involved in documenting the solution?� Programmer performs two activities
Reviewsprogram code — removes dead code, Reviewsprogram code — removes dead code, — removes dead code, program instructions that program never
executes
— removes dead code, program instructions that program never
executesReviews
documentationReviews
documentation
46
Summary of Programming Languages and Program DevelopmentSummary of Programming Languages and Program DevelopmentSummary of Programming Languages and Program DevelopmentSummary of Programming Languages and Program Development
Various programming languages used to write and develop
computer programs
Various programming languages used to write and develop
computer programsWeb development and multimedia
development toolsWeb development and multimedia
development toolsThe 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
development toolsdevelopment tools
Chapter 10 Complete
47
ADDITIONSADDITIONSADDITIONSADDITIONS
48
Other Programming LanguagesOther Programming LanguagesOther Programming LanguagesOther Programming Languages
What is RPG (Report Program Generator)?� Nonprocedural language used for generating reports,
performing computations, and updating files
49
Other Programming LanguagesOther Programming LanguagesOther Programming LanguagesOther Programming Languages
What are other available programming languages?
ALGOLALGOLALGOLALGOLADAADAADAADA APLAPLAPLAPL
BASICBASICBASICBASIC HYPERTALKHYPERTALKHYPERTALKHYPERTALKFORTRANFORTRANFORTRANFORTRANFORTHFORTHFORTHFORTHBASICBASICBASICBASIC HYPERTALKHYPERTALKHYPERTALKHYPERTALKFORTRANFORTRANFORTRANFORTRANFORTHFORTHFORTHFORTH
LISPLISPLISPLISP MODULAMODULA--22MODULAMODULA--22LOGOLOGOLOGOLOGO
PASCALPASCALPASCALPASCAL PROLOGPROLOGPROLOGPROLOGPL/1PL/1PL/1PL/1PILOTPILOTPILOTPILOT
SMALLTALKSMALLTALKSMALLTALKSMALLTALK
50
Other Program Development ToolsOther Program Development ToolsOther Program Development ToolsOther Program Development Tools
What is a macro?� Series of statements that instructs an application how
to complete a task
51
Web Page DevelopmentWeb Page DevelopmentWeb Page DevelopmentWeb Page Development
How are special effects and interactive elementsadded to a Web page?
ScriptScriptinterpreted
program that
AppletAppletusually runs on client, but
ServletServletapplet that
runs on
ActiveX ActiveX controlcontrol
small program
CounterCountertracks
number of visitors to Web site
Image mapImage mapgraphic
image that points to
URL
program that runs on client
on client, but is compiled
Processing Processing formform
collects data from visitors to Web site
runs on server
small program that runs on
client
52
Web Page DevelopmentWeb Page DevelopmentWeb Page DevelopmentWeb Page Development
What is a scripting language?� Typically easy to learn and use
� JavaScript� Perl (Practical Extraction
and Report Language)
� PHP (PHP: Hypertext Preprocessor)Preprocessor)
� Rexx (Restructured eXtended eXecutor)
� TCL (Tool Command Language)
� VBScript (Visual Basic, Scripting Edition)
53
Web Page DevelopmentWeb Page DevelopmentWeb Page DevelopmentWeb Page Development
What is Ajax?� Stands for Asynchronous JavaScript and XML� Method of creating interactive Web applications designed
to provide immediate response� Combines JavaScript, HTML or XHTML, and XML� Google Maps and Flickr use Ajax� Google Maps and Flickr use Ajax
54
Web Page DevelopmentWeb Page DevelopmentWeb Page DevelopmentWeb Page Development
What is Ruby on Rails(RoR)?� 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 SmalltalkLISP, Perl, and Smalltalk