You are on page 1of 5

COMPUTER PROGRAMMING

It is the process of designing and building an executable coputer programme for


accomplishing a

specific task.

It involves a set of instructions to be written in a programming language.

Types :-

1. Procedure Oriented Programmin


2. Object Oriented Programming

Procedure oriented Programming

 Large programs are divided into smaller programs called functions.


 Emphasis is on doing things ( algorithms).
 Most of functions share global data.
 Data move openly across the system from function to function.
 Top-down approach in program

Drawbacks
As global data is more vulnerable to an inadvertent change by a function.In large
programs it becomes difficult to identify what data is used by which function.

Object - Oriented Programming


 Emphasis is on data rather than procedure.
 Programs are divided into objects.
 Data structures characterize the objects.
 Functions that operate on data of an object are grouped together in the
data structure.
 Data of one function can't be accessed by another function.
 Objects may communicate with each other through functions.
 New data & functions may be added wherever necessary.
 Follows bottom-up approach in program.

C++
 History
It is an object-oriented programming language. It was developed by Bjarne
Stroustrup at AT & T Bell Laboratories in Murray Hill, New Jersey, USA in the early
1980's.C++ is an incremented version of C.

 Purpose of Designong C++


To make writing large programs a easier,pleasant and logical task for
programmers and to solve practical problems.1

C++ is a superset of C. Most of what we alredy know about C applies to C++ also.
So all C programs are also called C++ programs. However there's a difference in
the object-oriented features in C++ which allow even larege programs to run with
clarity, extensibility & ease of maintainance. These are inheritance,
polymorphism, Clases thereby making C++ a trurly object - oriented language.

APPLICATIONS -
1. C++ allows us to create hierarchy related objects, so we can build special
object-oriented libraries which can be used later by many programmers.
2. C++ is able to map real world problems properly.
3. C++ programs are easily maintainable and expandable.We can easily add a
new feature to the existing structure.
4. It is expected that C++ will replace C as a near future general - purpose
language in near future.

# PROGRAM FEATURES

1. Comments
Comments start double slash symbol and terminateat the end of line

2. Output Operation

cout <<"All is well";

causes the the string in quotation marks to be displayed on the screen.

3. The Iostream File

The header #include <iostream> causes the preprocessor to add the

content of iostream file to the program.It contains declaration for the

identifier cont and the operator <<.Iostream must be included in the

beginning of programs that use input/output statements.

4. Namespace
This defines a scope for the identifiers that are used in a program.For

using identifiers defined the namespace we must include

using namespace std;

Here std is the namespace where C++ standard libraries aw defined.


It brings all the identifiers defined in std to the current global scope.

5. Token
The smallest individual units in a program are known as tokens. C++

include the following tokens:

 Keywords
 Identifier
 Constants
 Operators

a) Keywords

These are explicitly reserved names and can't be used as names of any

other user-defined program elements.

b) Identifiers and Constants

Identifiers refer to the name of variable,function, arrays,classes etc.

created soy programmer

c) Classes & Objects

Objects are basic run-time entities in an object - oriented language.They

may represent a person,place,a table of data or user defined data such as

vectors,time and lists.Programming problem is analysed in terms of objects.

Object take up space in memory.

A Class in a single unit which encapsulates in itself data and functions related to

objects of the class.In fact, objects are variables of type class.

A class can also be called a collection of objects of similar type.


6. Variables

A variable is a named storage space in which we can store data.It's value is


changeable.It is always declared with a data type.The first letter of a variable must
be an alphabet and not a number.Blank spaces are not allowed in variable name
and it should not be a keyword.

7. Data Type

It tells the type of data that can be stored in a variable or used in a program.
There are many predefined data types like int, char, float etc.

-------------------0------------------

You might also like