Professional Documents
Culture Documents
XII
2014-2015
CERTIFICATE
This is to certify that Master Parth Sharma of class
XII of this Vidyalaya have successfully completed
the project entitled BANK MANAGEMENT SYSTEM.
The project has accomplished the satisfaction of
faculty concerned.
Mr.
S.K.
(In
charge
Externals signature
CERTIFICATE
This is to certify that Master Nitesh Pandya of
class XII of this Vidyalaya have successfully
completed
the
project
entitled
BANK
MANAGEMENT
SYSTEM.
The
project
has
accomplished
the
satisfaction
of
faculty
concerned.
Mr.
S.K.
(In
charge
Externals signature
INTRODUCTION TO
C++
C++ (pronounced as cee plus plus) is a generalpurpose
programming
language.
It
has
imperative,
object-oriented
and
generic
programming features, while also providing the
facilities for low-level memory manipulation.
many
other
contexts,
including
desktop
applications, servers (e.g. e-commerce, web
search or SQL servers), performance-critical
applications (e.g. telephone switches or space
probes), and entertainment software. C++ is a
compiled language, with implementations of it
available on many platforms and provided by
various organizations, including the FSF, LLVM,
Microsoft and Intel.
National
C++
Programming Paradigms:
A paradigm means organizing principle of a
program. It is an approach to programming.
Since the invention of the computer, many
programming approaches have been tried such as
procedural programming, modular programming,
structural
programming
etc.
The
primary
motivation in each case has been the concern to
handle the increasing complexity of programs that
are reliable and maintainable.
Procedural Programming:
A program in a procedural language is a list of
instructions where each statement tells the
computer to do something. The focus is on the
Modular Programming:
With the increase in program size, a single list
of instruction becomes unwieldy. Thus a large
program is broken into smaller units i.e.
functions (sub-programs). The idea of breaking
program can be further extended by grouping a
number of functions together into a larger entity
called a module, but the basic principle remains
similar: grouping of components that carry out
specific task.
Module: A set of related procedure with the data
they manipulate is called a module.
Encapsulation
Encapsulation is the hiding of information to
ensure that data structures and operators are
used as intended and to make the usage model
more obvious to the developer. C++ provides the
ability to define classes and functions as its
primary encapsulation mechanisms. Within a
class, members can be declared as either public,
protected, or private to explicitly enforce
encapsulation. A public member of the class is
accessible to any function. A private member is
accessible only to functions that are members of
that class and to functions and classes explicitly
granted access permission by the class
SYNTAX
Suppose the class I discussed earlier, the class would be
called employee. A class name is defined by the keyword
class and then the name. For our employee class that would
be:
class employee
Notice that there is no semicolon following employee. This is
because after the class name comes the class definition.
Here's our class definition (including the class name):
Objects
Instances of classes are called objects. You can create an
instance of a class by doing the following:
classname objectname;
This will allocate the memory needed for a class to exist
because when the class is defined it will not be created yet.
It will be created when you declare an instance of the class,
thus the name object. To create an object ofemployee we
would do this:
employee mechanic;
Creating objects is done in main, WinMain, or any other
function that is non-related to the class.
Using objects
The example above showed us how to create an object. This
part of the article will show you how to use an object. We
declared the object mechanic, now we want to use it to
set name in our class. We can access a member or member
function in the class by using the class member access
operator or also called the dot operator (.). However, we
cannot get direct access to private data, I'll explain more
about that later on. So we'll have to use a member function.
Using the dot operator we can invoke this. The syntax is as
follows:
mechanic.set_name("John Doe");
Pointer notation
Well then what's the deal with a pointer to an object? It's
practically the same except that the dot operator is being
replaced by the member access operator (->). Here's an
example:
employee mechanic;
employee* ptrmechanic;
ptrmechanic = &mechanic;
ptrmechanic->set_name("John Doe");
This cannot be used by objects! Only by pointers to objects.
Access specifiers
public and private are access specifiers. Simply put, they
exist for the sake of security. They specify the kind of access
given to the members and member functions of the class. In
our
class, name is
a private member
ofemployee while set_name and display_name are public me
mber functions of employee. The access specifierpublic gives
the entire program access to the data that follows it. While
the access specifier private only gives the member functions
in the class access to the data that follows it. There is one
other access specifier: protectedbut it only becomes useful in
inheritance, which will be what part 2 is all about.
CONSTRUCTORS AND
DESTRUCTORS
Constructors
One of the many cases in which the constructor will be used
is when it is preferred to have the members of the class
being initialized to certain values immediately when the
object is declared. Constructors are functions that have no
return types and have exactly the same name as the
class, this must always be how a constructor is
defined! Why you ask? Because a constructor has no need
to return a value, and by giving it the same name as the
class the compiler can directly see if it is a constructor or
not. However, there is always a constructor, even if you not
define one. One of the constructor's functions (functions not
to be taken as a programming term) is to allocate the
amount of memory needed for the class when the object is
declared. This is why there is always a constructor.
Constructors can take arguments though. A good example of
when an argument is taken by a constructor is the copy
constructor which takes an object of the same class and
copies it's members' values into it's own members' values.
Destructors
Destructors are used to destroy an object at the end of the
program. Like the constructor, the destructor is always there,
even if you not define one. BUT when there is a written
constructor, it is a general good practice to also write a
destructor for it.
Syntax
The best way to explain the syntax of constructors and
destructors is by changing our employee class definition:
const int SIZE = 40;
class employee
{
private:
char name[SIZE];
public:
//constructor, note: wrong initializtion list (array as string)
employee() : name("Unemployed")
{
}
~employee() //destructor
{
}
void set_name(char arg_name[SIZE])
{
strncpy(name, arg_name, SIZE);
}
void display_name(void)
{
cout << name;
}
};
Notice that after the employee() part in the constructor there
is a colon, after that comes the so called initialization list.
This is used to initialize variables with certain values (which
can of course also be the arguments of a constructor). The
initialization list is widely used in constructors. In
our employee class the body of the constructor is empty, this
does not have to be the case. You can also leave the
initialization list out and put the part in the initialization list
in the body, like this:
employee() //constructor
{
strncpy(name, "Unemployed", SIZE);
}
This one will work UNLIKE the other one above, because
when you're dealing with arrays you cannot specify an
explicit initializer. In other words, the initialization list will not
work on arrays treated as strings. I put it in anyway because
I wanted to show you the basic use of the initialization list.
The destructor
The destructor destroys everything created by the class
automatically, you can say it was a last will of the class. You
do not have to put any delete keywords in it, except if you
allocated any memory with the new keyword. For everything
else it does the work for you. It has the same name as the
class preceded by a tilde (~). Unlike the constructor, the
destructor takes no arguments. That sounds logical because
you would never need arguments when everything is
destroyed. However, the function body does not have to be
empty in a destructor. Why you ask? Well there is one good
reason why, for example when you want to debug your
program you could state something like this:
~employee() //destructor
{
cout << "Destructor called.";
/*the following would be required IF the variable name
was allocated with the new keyword*/
delete[] name;
}
There is always only one destructor in an entire class, unlike
the constructors which there can be more of.
Argumented constructors
When a constructor is argumented, the syntax for the object
declaration changes to:
now
Multiple constructors
You can also define multiple constructors for use in one class,
like this:
employee() //no argument constructor
{
strncpy(name, "Unemployed", SIZE);
}
employee(char arg_name) //one argument constructor
{
strncpy(name, arg_name, SIZE);
}
You can also define multiple constructors which have the
same amount of arguments, however, you cannot define
multiple constructors that take the same types of arguments.
The compiler simply wouldn't know which constructor to call.
This way you can choose how to declare your object. The
methods showed in the Argumented constructors part will
now both work.
HISTORY OF C++
Bjarne Stroustrup, a Danish computer scientist,
began his work on C++'s predecessor "C with
Classes" in 1979. The motivation for creating a
new language originated from Stroustrup's
experience in programming for his Ph.D. thesis.
Stroustrup found that Simula had features that
were very helpful for large software development,
but the language was too slow for practical use,
while BCPL was fast but too low-level to be
suitable for large software development. When
Stroustrup started working in AT&T Bell Labs, he
had the problem of analyzing the UNIX kernel with
respect to distributed computing. Remembering
his Ph.D. experience, Stroustrup set out to
enhance the C language with Simula-like features.
C was chosen because it was general-purpose,
fast, portable and widely used. As well as C and
Simula's influences, other languages also
influenced C++, including, ALGOL 68, Ada, CLU
and ML.
Etymology
According to Stroustrup: "the name signifies the
evolutionary nature of the changes from C". This
name is credited to Rick Mascitti (mid-1983) and
was first used in December 1983.
Philosophy
Throughout C++'s life, its development and
evolution has been informally governed by a set
of rules that its evolution should follow:
Standardization
C++ is standardized by an ISO working group,
JTC1/SC22/WG21. So far it has seen three versions
of C++ released and is currently working on
releasing C++14.
CONSTRUCTORS
therefore,
cannot
derived class
constructor.
be
can
inherited,
call
the
though
baseclass
PARAMETERIZED CONSTRUCTORS
The
constructor
Integer(),
defined
above,
initialized the data members of all the objects
to zero. However in practice it may be
necessary
to
initialize
the
various
data
elements of different objects with different
values when they are created. C++ permits
us to achieve this objective by passing
arguments to the constructor function when
BENEFITS OF OOPS
OOP offers several benefits to both the program
designer and the user. The principal advantages are.
i)
ii)
iii
)
iv
)
v
)
vi)
vii)
viii)
T
hr
o
u
g
h
in
h
er
it
a
nc
e,
w
e
ca
n
eli
m
in
at
e
re
d
u
n
d
a
nt
co
d
e
a
n
d
ex
te
n
d
th
e
us
e
of
ex
ist
in
g
classes
We can build program from
the standard working module
that communicate with one
another, rather than having to
start writing the code from
scratch. This leads to saving
of development time and
higher productivity.
The principal of data hiding
helps the programmer to
build secure programs that
cannot be invaded by code
in other part of the
program.
It is possible to have multiple
instance of an object to coexist without any interference
It is easy to partition the
work in a project, based on
objects. Object oriented
systems can be easily
upgraded from small to large
systems.
Message passing
techniques for
communication between
objects makes the interface
description with external
systems much simpler.
Software
complexity can be
easily managed.
LANGUAGE
Operators and operator overloading
C++ provides more than 35 operators, covering
basic arithmetic, bit manipulation, indirection,
comparisons, logical operations and others.
Almost all operators can be overloaded for userdefined types, with a few notable exceptions
such as member access (. and .*) as well as the
conditional
operator.
The
rich
set
of
overloadable operators is central to making
user-defined types in C++ seem like built-in
types. Overloadable operators are also an
essential part of many advanced C++
programming techniques, such as smart
pointers. Overloading an operator does not
change the precedence of calculations involving
the operator, nor does it change the number of
operands that the operator uses (any operand
may however be ignored by the operator,
though it will be evaluated prior to execution).
Overloaded "&&" and "||" operators lose their
short-circuit evaluation property.
49
OBJECT STORAGE
C++ supports four types of memory
management:
Static storage duration objects
Thread storage duration objects
Automatic storage duration objects
Dynamic storage duration objects
49
WHY OBJECT
ORIENTED
PROGRAMMING?
With the rapidly changing world and the highly
competitive
and
versatile
industry,
the
operations are becoming more and more
complex. In view of increasing complexity of
software systems, the software industry and
software engineering continuously look for the
new approaches to software design and
development. The increased complexity had
become the chief problem with computer
programs in traditional languages. Large
programs due to complexity are more prone to
errors and software errors can be expensive and
even life threatening. The most adopted and
popular programming approach, structured
programming approach, failed to show the
desired results in terms of bug-free, easy-tomaintain, and reusable programs. The latest
programming
approach
Object
Oriented
Programming (OOP), offers a new and powerful
way to cope with complexity. Its goal is clearer,
more
reliable,
more
easily
maintained
49
INTRODUCTION TO
PROJECT
This program is totally based on new concept
and no part of it is copied from any other
program either from internet or from any book.
The program is specially designed for a bank.
49
removes
the
account
from
49
the
bank
SCREENSHOTS FROM
THE PROGRAM
Main Screen :
49
SCREENSHOTS FROM
THE PROGRAM
New Account Screen:
49
SCREENSHOTS FROM
THE PROGRAM
Deposit Money Screen:
49
SCREENSHOTS FROM
THE PROGRAM
Withdraw Money Screen:
49
SCREENSHOTS FROM
THE PROGRAM
View Details of a Specific Account:
49
SCREENSHOTS FROM
THE PROGRAM
Bank Database Screen (All Accounts):
49
SCREENSHOTS FROM
THE PROGRAM
Close An Account Screen:
49
_____________________________________________________________________
SCREENSHOTS FROM
THE PROGRAM
Modify an Account:
49
SCREENSHOTS FROM
THE PROGRAM
Exit from the Program:
49
LIMITATIONS
This Program cannot perform all the functions
of a bank.
It does not have (GUI) Graphical User
Interface.
49
MINIMUM SYSTEM
REQUIREMENTS
Windows 95, 98, 2000, Me, Xp, 8, 8.1 or more.
Dev C++ compiler.
64 MB RAM.
CD ROM Drive.
1 MB free hard disc space.
BIBLIOGRAPHY
C++ help.
49
49