Sunteți pe pagina 1din 27

INTRODUCTION

DEFINITION OF TERMS
A computer program, or just a program, is a
sequence of instructions, written to perform a
specified task with a computer. A computer
requires programs to function, typically
executing the program's instructions in a
central processor.
The program has an executable form that the
computer can use directly to execute the
instructions. The same program in its human-
readable source code form, from which
executable programs are derived (e.g., compiled
), enables a programmer to study and develop
its algorithms. A collection of computer
programs and related data is referred to as the
software.
Computer source code is typically written by
computer programmers.
In computing, source code is any collection of
computer instructions (possibly with comments)
written using some human-readable
computer language, usually as text.
A programmer, computer
programmer, developer, coder,
or software engineer is a person who writes
computer software. The term computer
programmer can refer to a specialist in one area
of computer programming or to a generalist who
writes code for many kinds of software.
A programming language is a formal
constructed language designed to communicate
instructions to a machine, particularly a
computer. Programming languages can be used
to create programs to control the behavior of a
machine or to express algorithms.
In computer science, the syntax of a
computer language is the set of rules that defines
the combinations of symbols that are considered
to be a correctly structured document or
fragment in that language.
A software bug is an error, flaw, failure, or
fault in a computer program or system that
causes it to produce an incorrect or unexpected
result, or to behave in unintended ways.
Debugging is a methodical process of finding
and reducing the number ofbugs, or defects, in a
computer program or a piece of
electronic hardware, thus making it behave as
expected.
Types of Computer Languages
MACHINE LANGUAGE: The most elementary and
first type of computer, which was invented, was
machine language. Machine language was machine
dependent. A program written in machine language
cannot be run on another type of computer without
significant alterations. Machine language is some
times also referred as the binary language i-e, the
language of 0 and 1 where 0 stands for the absence of
electric pulse and i stands for the presence of electric
pulse. Very few computer programs are actually
written in machine language.
ASSEMBLY LANGUAGE: As computer became more
popular, it became quite apparent that machine language
programming was simply too slow slow tedious for most
programmers. Assembly languages are also called as low
level language instead of using the string of members
programmers began using English like abbreviation to
represent the elementary operation. The language
provided an opportunity to the programmers to use
English like words that were called MNEMONICS.

http://www.cplusplus.com/doc/tutorial/in
troduction/
HIGH LEVEL LANGUAGE: The assembly
languages started using English like words, but
still it was difficult to learn these languages.
High level languages are the computer language
in which it is much easier to write a program
than the low level language
Types of High Level Languages

Many languages have been developed for


achieving different variety of tasks, some are
fairly specialized others are quite general
purpose.
These are categorized according to their use as:
a) Algebraic Formula-Type Processing.
These languages are oriented towards the
computational procedures for solving
mathematical and statistical problem
Examples are:
BASIC (Beginners All Purpose Symbolic
Instruction Code).
FORTRAN (Formula Translation).
PL/I (Programming Language, Version 1).
ALGOL (Algorithmic Language).
APL (A Programming Language).
b) Business Data Processing:
These languages emphasize their capabilities for
maintaining data processing procedures and
files handling problems. Examples are:
COBOL (Common Business Oriented
Language).
RPG (Report Program Generator
c) String and List Processing: These are used
for string manipulation including search for
patterns, inserting and deleting characters.
Examples are:
LISP (List Processing).
Prolog (Program in Logic).
D) Object Oriented Programming Language
In OOP, the computer program is divided into objects.
Examples are:
C++
Java
e) Visual programming language: these are designed
for building Windows-based applications Examples are:
Visual Basic
Visual Java
Visual C
FUNDAMENTALS OF PROGRAMMING

JSRABI
C++ Language
Introduction
Compilers
The essential tools needed to follow these tutorials are a computer and a compiler toolchain
able to compile C++ code and build the programs to run on it.

C++ is a language that has evolved much over the years, and these tutorials explain many
features added recently to the language. Therefore, in order to properly follow the tutorials,
a recent compiler is needed. It shall support (even if only partially) the features introduced
by the 2011 standard.

Many compiler vendors support the new features at different degrees. See the bottom of this
page for some compilers that are known to support the features needed. Some of them are
free!

If for some reason, you need to use some older compiler, you can access an older version of
these tutorials here(no longer updated).
What is a compiler?
Computers understand only one language and that
language consists of sets of instructions made of ones
and zeros. This computer language is appropriately
called machine language.

A single instruction to a computer could look like this:

0000010011110
A particular computer's machine language
program that allows a user to input two
numbers, adds the two numbers together, and
displays the total could 00000
include these machine
10011110
code instructions: 00001 11110100
00010 10011110

00011 11010100

00100 10111111

00101 00000000
As you can imagine, programming a computer directly in
machine language using only ones and zeros is very
tedious and error prone. To make programming easier,
high level languages have been developed. High level
programs also make it easier for programmers to inspect
and understand each other's programs
1 easier. int a, b,
sum;
2
This is a portion of code written
in C++ that accomplishes the 3 cin >> a;
4 cin >> b;
exact same purpose:
5
6 sum = a + b;

7 cout << sum


<< endl;
Even if you cannot really understand the code above, you should be able to
appreciate how much easier it will be to program in the C++ language as opposed
to machine language.

Because a computer can only understand machine language and humans wish to
write in high level languages high level languages have to be re-written (translated)
into machine language at some point. This is done by special programs called
compilers, interpreters, or assemblers that are built into the various programming
applications.

C++ is designed to be a compiled language, meaning that it is generally translated


into machine language that can be understood directly by the system, making the
generated program highly efficient. For that, a set of tools are needed, known as
the development toolchain, whose core are a compiler and its linker.

S-ar putea să vă placă și