BMS 201 C++Programming Concepts 2021
BMS 201 C++Programming Concepts 2021
MODES OF PROGRAMMING
Monolithic programming refers to the
largely undisciplined and non formalized
approach to the development of a
computer programs in which the
programme is allowed a completely free
rein. Programs produced in this way
reflect the programmer's own experience
and personal interpretations.
become available more quickly as a
result.
MODES OF PROGRAMMING
Modular programming is the approach to
programming that adopts a technique of
developing suites of related programs. The
overall program is divided into parts or
modules, each of which is developed
separately but on a coordinated basis. This
enables the complete suite of programs to be
prepared by the team of programmers if
appropriate and programs become available
more quickly as a result.
MODES OF PROGRAMMING
Structured programming is an approach to
writing programs that are easier to read, test,
debug and modify. The approach assists in the
development of large programs through
stepwise refinement and modularity.
Structured programming serves to increase
programmer productivity, program reliability
(readability and execution time), program
testing, program debugging and serviceability.
MODES OF PROGRAMMING
Macros – these are single instruction written
as a part of a program that will generate many
machine code instructions. They are
applications software commands which are
batched to perform a certain task which is
performed frequently. When the usual task is
to be performed, the invoking key to the
macro is pressed and the task is performed.
They are also useful where a user defines own
macros to facilitate the use of an application
package.
PROGRAMMING PARADIGMS
debits and adds all the credits for the period and then
you arrive at closing balance. The key point for
procedural programming is identification and
articulation of the process or steps that must be
followed. In general terms, POP is a methodology for
modelling the real world or the problem being solved,
by determining the steps and the order of those steps
that must be followed in order to reach a desired
outcome or specific program state.
Characteristics of POP
function to another
The large programs are divided into smaller programs
(i.e. functions)
Most of the functions share global data
It uses the top-down approach in program design
POP limitations:
The POP does not model the real world problems very
well because its functions are action-oriented, hence
the functions do not correspond to the elements of the
problem.
The programmers are forced to re-invent new solutions
OOP is a methodology for modelling the real world (or at least the
problem being solved), by decomposing the problem into smaller
discrete pieces called objects.
What makes an object unique is the formal and explicit
combination these smaller pieces' behaviour with its data into a
single entity. The object's behaviours are called methods in OO
terminology, while its data is called the Object's state.
The OOP approach provides a way of modularizing programs by
creating partitioned memory area of both data and functions that
can be used as templates for creating copies of such modules on
demand.
The OOP ties the data more closely to the functions that operate on
it, and protects it from accidental modification by external
functions.
The OOP allows the decomposition of a problem into a number of
objects and then builds data and functions around the objects.
The characteristics of OOP
The emphasis is on data rather on procedure
Programs are divided into objects
Data is hidden and cannot be accessed by external functions
Objects communicated with each other through functions
New data and functions can be easily added whenever necessary
Functions that operate on the data of an object are tied together in
the data structure
Data structures are designed in such a way that they characterize
the objects
OOP uses the bottom-up approach in program design (i.e. the
overall program development is based upon the known
characteristics of the individual modules.
BASIC CONCEPTS OF OOP
operation:
For two numbers generates a sum.
e.g.: 3 + 5 = 8,
For two words generates a third string through concatenation of
the wo
strings. e.g.:
Computer + Programming =
ComputerProgramming
Example
In OOP, polymorphism is used to describe variables
which may refer at run time to objects of different
classes. A single function can be used to handle
different number and different types of arguments. The
usage of a function to perform different types of tasks
is referred to as overloading
Interface: This refers to a boundary across which two