Download There are different kinds of voice or speech "engines" that take the

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Functional programming wikipedia , lookup

Reactive programming wikipedia , lookup

Falcon (programming language) wikipedia , lookup

Abstraction (computer science) wikipedia , lookup

Compiler wikipedia , lookup

History of compiler construction wikipedia , lookup

Go (programming language) wikipedia , lookup

Programming language wikipedia , lookup

Structured programming wikipedia , lookup

Assembly language wikipedia , lookup

Object-oriented programming wikipedia , lookup

Interpreter (computing) wikipedia , lookup

C Sharp (programming language) wikipedia , lookup

Transcript
Identify object-oriented programming
languages
Computer Programs
A computer program is a series of instructions
that direct a computer to perform specific tasks.
A programming language is a set of words,
symbols, and codes that enable a programmer to
instruct the computer to perform a set of tasks.
Programming languages are either low-level or
high-level.
Low-level Programming Languages
 Machine Language - a first
generation computer
language
 Assembly Language – a
second generation computer
language
Machine Language
(First Generation Language)
Machine language uses a series of binary digits (1s and 0s), or
combinations of numbers and letters that represent binary digits,
and is the only language a computer directly understands.
00090
000090
50E0
30B2
010B4
000094
1B44
000096
1B55
000098
F273
30D6
00009A
4F50
30D6
0000A0
F275
30D6
0000A4
4F70
30D6
010D8
0000AE
5070
304A
0104C
0000B2
1C47
0000B4
5050
304E
01050
0000B8
58E0
30B2
010B4
0000BC
07FE
2C81
010D8
00C83
010D8
2C7B
010D8
00C7D
Assembly Language
(Second Generation Language)
Assembly language uses symbolic instruction codes.
Symbolic instruction codes are meaningful abbreviations & codes in which “A”
might stand for addition, “C” might stand for compare, or “M” might stand for
multiply.
Assembly languages also use symbolic addresses to identify storage locations.
For example, RATE might refer to a storage location that contains the pay rate
being used in the program.
This language is slightly more user friendly than machine language.
CALCPAY
EQU
*
ST
14,SAVERTPY
SR
4.4
SR
7.7
SR
5.5
PACK
DOUBLE,RTHRSIN
CVB
4.DOUBLE
ST
7.RATE
High-Level Languages
(Procedural Programming Languages)
With a procedural language, or third-generation language (3GL),
programmers write instructions using code that is very similar to the
English language, which simplifies the program development process.
For example, ADD stands for addition and PRINT means to print.
Arithmetic operations are represented by + for addition, - for subtraction,
/ for division, and * for multiplication.
*
COMPUTE REGULAR TIME PAY
MULTIPLY REGULAR-TIME HOURS BY HOUR-RATE
GIVING REGULAR-TIME-PAY
*
COMPUTER OVERTIME PAY
IF OVERTIME-HOURS >0
COMPUTER OVERTIME-PAY = OVERTIME-HOURS * 1.5 * HOUR RATE
ELSE
MOVE 0 TO OVERTIME PAY
High-Level Languages
(Procedural Programming Languages)
Popular Standard procedural languages are:
BASIC—a simple, interactive problem-solving language
COBOL—a language designed for business applications
C—a powerful language that requires professional programming skills
High-Level Languages
(BASIC)
Below is an example of code written in BASIC:
Sample 1: Unstructured original BASIC (Applesoft BASIC)
Sample 2: Modern Structured BASIC (e.g. QBASIC)
High-Level Languages
(COBOL)
An example of
code written in
COBOL.
COBOL stands for
Common Business
Oriented Language
High-Level Languages
(C)
Below is an example of code written in “C”:
/* Computer Regular Time Pay
*/
rt_pay – rt_hrs * pay_rate;
/* Computer Overtime Pay
*/
if (ot_hrs > 0)
ot_pay – ot_hrs * 1.5 * pay_rate;
else
ot_pay = 0;
/* Compute Gross Pay
*/
Gross – rt_pay * ot_pay;
/* Print Gross Pay
Printf(“The gross pay is %d\n”. gross):
*/
Compiling or Interpreting
Computer Code
A tcompiler or an interpreter ranslates the 3GL source program into a
machine language object code that a computer can execute.
An interpreted program runs each line of code individually and translates it
into machine language while it is executing the program.
A compiled program is run through a compilation process that converts the
entire program from the source code into machine code. Compiled
programs run much faster than interpreted programs and are usually
identified by the filename extension of .exe.
Visual Programming
Visual programming languages are sometimes called fifth-generation
languages (5GL) and provide a visual or graphical interface, called a
visual programming environment (VPE) for creating source code.
Visual Programming
Rapid Application Development (RAD)
Visual programming languages are
often used in a rapid application
development (RAD) environment.
RAD allows programmers to
implement a program in segments
and use pre-built components which
simplify program development.
An example of RAD would be the icons
shown on the above desktop and folder.
The icon of the diskdrive representing
the computer drives is used in several
places – but the same routine is used to
create all of them.
Visual Programming

Visual programming
languages include:

Visual Basic .NET 2003
Visual C++ .NET 2003
Visual C# .NET 2003
Delphi
PowerBuilder




This is an example
of a Visual Basic
6.0 environment
used to create a
program in Visual
Basic.
Characteristics of Object-Oriented
Programming Languages
Programmers use an object-oriented programming
(OOP) language to implement object-oriented design.
An object is an item that can contain both data and the
procedures that read or manipulate the data.
A major benefit of OOP is its ability to reuse and modify
existing objects, which allows programmers to create
applications faster.
OOP languages include C++, which is an object-oriented
extension of the C programming language, and Java,
which is similar to C++ but uses a just-in-time (JIT)
compiler to convert its source code into machine code.
Web Page Written in HTML
On the right is the HTML code that produced the webpage shown on the left.
Examine the code and see if you can determine what some of it does.
See if you can explain what the code in red does.
<html>
<Head>
<center>
<Title>DogieO's Homepage</title>
<br>
</head>
<body bgcolor="#FFFFFF" text="#OOOOOO">
<h1>DoggieO's Home Page</h1>
<br>
<image src="doggieo.gif">
<br>
Hello, my name is DoggieO. I enjoy all aspects of life, especially chasing other
animals.<br>
I am a freshman at Cannine High School where I am on the Fetch Team.<br>
Below are my favoriate links.<br>
<br>
<a href="http://www.Petsmart.com">Petsmart where I get my food and
toys.</a><br>
<a href="http://www.google.com">Google Search Engine where I get all my
information.</a><br>
<br></center>
</body>
</html>
Web Page Written in Java
On the right is the Java code that makes the buttons on the left page change color. When
the user “mouse-overs” the button, it switches the graphic which represents the button so
that the button appears to change colors or “light up” showing it is active. Below are the two
buttons that switch in and out of the page as a result of the Java script code below.
<title>Pop Activities Page</title>
script LANGUAGE="JavaScript"><!-if (navigator.userAgent.indexOf("Mozilla") != -1)
{
if (parseInt(navigator.appVersion) > 2) BrowserOK = 1;
else BrowserOK = 0;
}
function highlight(img) { if (BrowserOK == 0) return;
document[img].src = img + "G.jpg";
}
function unhighlight(img) { if (BrowserOK == 0) return;
document[img].src = img + "S.JPG";
}
// -->
</script>
As you can see, we have many languages. Below are just a few.
Languages are improved upon or new languages are developed
as we find new applications and uses for computers.
Although we have many languages, they all share common elements;
so it is easy to learn and program in other languages once you are
exposed to writing code for one program language.