Information Technology Reference
In-Depth Information
Figure 4.21
Microsoft Visual Basic
After they are developed as part of a C++ program, the instructions or method can be
used in other programs to compute the area of a picture frame, a living room, a front lawn,
or any other application that requires the area of a rectangle. Following are a few instructions
in another C++ program that show how to use the ComputeArea method to compute the
area of a picture frame.
//Assign Data and Compute Area
frameObject -> SetDimensions (frameWidth, frameLength);
frameArea = frameObject -> ComputeArea();
Programming languages used to create artificial intelligence or expert systems applications
are often called fifth-generation languages (5GLs) . FLEXPERT, for example, is an expert sys-
tem used to perform plant layout and helps companies determine the best placement for
equipment and manufacturing facilities. Fifth-generation languages are sometimes called
natural languages because they use even more English-like syntax than 4GLs. They allow
programmers to communicate with the computer by using normal sentences. For example,
computers programmed in fifth-generation languages can understand queries such as, “How
many athletic shoes did our company sell last month?”
With third-generation and higher-level programming languages, each statement in the
language translates into several instructions in machine language. A special software program
called a compiler converts the programmer's source code into the machine-language instruc-
tions consisting of binary digits, as shown in Figure 4.22. A compiler creates a two-stage
process for program execution. First, the compiler translates the program into a machine
language; second, the CPU executes that program. Another approach is to use an inter-
preter , which is a language translator that carries out the operations called for by the source
code. An interpreter does not produce a complete machine-language program. After the
statement executes, the machine-language statement is discarded, the process continues for
the next statement, and so on.
compiler
A special software program that
converts the programmer's source
code into the machine-language
instructions consisting of binary
digits.
 
 
Search WWH ::




Custom Search