Professional Documents
Culture Documents
COURSEWORK ASSESSMENT
1. Quiz (4) – 10 %
2. Problem Based Exercise (3) -20%
3. Problem Based Task (2) - 40%
OUTCOMES
At the end of this chapter, you will be able to:
Describe the programming language
Describe fundamentals of programming languages.
1.1 DESCRIBE THE
PROGRAMMING LANGUAGE
LANGUAGE
According to
Language
1. The method of human communication
using spoken or written words
Assembler
Machine Language
Instruction is written as a series of English-like
words.
Translation to machine language is performed
using compiler or interpreter.
Starting from 3rd Generation language and
above, written programs are no longer
dependent on the type of CPU and can be run in
any machine.
FORTRAN – designed for scientific
application and used by engineers,
scientists and mathematicians.
COBOL – more widely used for business
applications.
BASIC – easy to learn and widely used in
education and business application.
C/C++ - powerful and fast, used in many
areas.
Also uses English-like statements.
Variations on 4GLs are query languages, which can be used to retrieve
data from database.
The main domains and families of 4GLs are:
database queries,
report generators,
data manipulation,
analysis and reporting,
screen painters and generators,
GUI creators,
mathematical optimization,
web development
general purpose languages.
Example: MAPLE, MATHEMATICA, POSTSCRIPT, SPSS, SQL
Many 4GLs are associated with databases and data processing,
allowing the efficient development of business-oriented systems
4GLs are mostly based on the Structured Query Language (SQL) for
managing structured data.
Most 4GLs contain the ability to add 3GL-level code to introduce
specific system logic into their program.
The codes resemble the human language.
Normally associated with artificial intelligence
built up through logic programming.
The use of natural languages to access
knowledge as a knowledge-base system or
expert system.
Example, Prolog.
Machine Languages
Using Vacuum Tubes
Assembly Languages
Using Transistors
Programming:
Programming is a process of designing/ creating a program.
Programmer:
Programmer is a person who designs, writes and test the program.
A computer can only understand programs defined using machine
code.
For example, a program written in Java cannot be run directly from a
computer.
To execute a computer program written in high or low level language,
it must be first be translated.
A translator is a program that:
1. Assemblers
2. Compilers
3. Interpreters
A program used to convert assembly language into
machine language.
Translates the whole program at one time.
Also called assembler program.
sseg segment stack
db 256 dup (?)
sseg ends 11101 100000
100000
dseg segment 11110
data db “2 x 4 = ” 10111000
dseg ends
Assembler 11101000
cseg segment 11111100
assume cs:cseg:ds:sdeg:ss:sseg. 10111000
es:nothing 10001110 11011000
Start 10111000
10001110 11000000
Compiler Process
# include <iostream> 11101 100000
using namespace std; 100000
11110
main( ) 10111000
{
11101000
int x, y, sum;
11111100
double avg; Compiler 10111000
cout<<" Enter 2 numbers : "; 10001110 11011000
cin >> x >> y; 10111000
sum = x + y; 10001110 11000000
avg = sum / 2;
cout<<" X : " << x <<“\nY : "<< y;
cout<<“The average is = "<< avg;
system("pause");
return 0;
}
Machine Language
C++ Language
Source File
Other Object Files
Object File
Executable File
Error messages