Training Report
Training Report
ON
BANKING MANAGEMENT
SUBMITTED BY:
PRIYANKA MUNJAL
B.Tech FINAL YEAR
(Computer Science )
(JAGADHRI)
(Software to manage all the data regarding
banking )
Technology used:-
‘C++’
2
Abstract
The technology used in this project is C++. This report provides the
knowledge regarding the platform used in the project.
3
4
ACKNOWLEDGEMENT
While developing the project, I have learnt a lot. Firstly I got the
explosure to the industry. We got to learn the work culture of a company.
This will be an unforgetful experience. While developing this project, a
lot of difficulties were faced by me. But it was the help of some special
people that I have gained much confidence and developed the project
quite well. Hereby, I shall like to thank all the employees of NIC to
coordinate with me and provide me the information needed to complete
the analysis part of this project. I shall like to thank everyone who in
anyway helped me in this project.
Priyanka Munjal
5
6
TABLE OF CONTENTS
Part- 4 CODING
Part- 5 BIBLIOGRAPHY
Chapter 5 :- Biblography
7
8
NATIONAL INFORMATIC CENTER (NIC) : A Profile
Organization Setup
The organizational set up of NIC encompasses its headquaters at New Delhi State
units in all the 29 State Capitals and 6 Union Territory Headquaters, and District
centers of India. The Organization employs a large pool of efficient technical
manpower. At the NIC Headquaters, a large number of Application Divisions exit
which provide total Informatics Support to the Ministeries and Departments of the
Central Government. NIC software is a leading technology company with the global
out reach specializing in providing top solutions for all category users. Their strong
commitment towards quality has secured us a privileged position in a fast evolving
market, the key advantage being a state of art of product based on cutting edge
technologies.
The company delivers a full service offerings that helps numerous customers achieve
maximum return on their investment through dedicated software experts, management
tools and product selection consultation on business critical soft wares, including
desktop, storage, security infrastructure and data management.
Company History
NIC was founded in 1988 and is Government owned. Since its first day of Business,
NIC has required no financial Banking or assistance the company has been self
sufficient and profitable in all years of operation.
The training Coordinator of company are Mr. Hari Chand who are highly educated
and each having 9 to 10 years of experience in this industry. The company mission
and culture has reminded constant over the years.
Goal
The goal of NIC is to be responsive to its users and provide them with software
solution to assist them in being more efficient and productive in their work.
The company plans on continually improving software to help its clients take
advantage new technology.
9
The company
The Company is
Producing, developing and internationally distributing high quality
software products.
Providing integrated solutions for data security and reliable services in
files like software distribution, consultancy and technical support.
Providing solutions in banking, healthcare, insurance and publishing
industry.
The People
The people are their key strength. They pick and nurture the best to create an
awesome base of expertise and talent. They are a team of young professionals,
enthusiastic and talented people.
Software programmers, product managers or technical support people, the company is
committed to provide their clients with high quality products and flawless technical
support. The people working in sales, marketing and administration divisions are all
client driven, closely co-operating with the software developers, therefore making
them as an unbeatable team.
The Capabilities
The reliability of the products, the flexible licensing program and the low
prices show their commitment towards their clients. NIC software strategic
partnership with reputable companies allover the world has created a global network
with excellent results and outstanding performance in the distribution of software
products.
10
The Product
The products are characterized by innovation hip, ease of use and multiplatform
supports. The software developed is supporting the large variety of operating systems.
The systems undertaken by NIC are as under:
Developed publishing software for ICCC publications, which involved the
compilation of all the cases of all high court and Supreme Court and effective
search engine utility for finding relevant cases.
Developing an in-house EPR projects for US based company, electrical
company radius power. The company is into design, manufacturing and sales
of electrical equipments like SNMPS, filters and EMI etc. The ERP software
being developed cover productions, finance, marketing and sales & purchase
modules.
Designed and developed management system for a reputed employment or
organization, VSS private limited, which specializes in human resource
development.
Developed an office Automation suite for the various offices of Vardaan
sales LTD, a leading garment manufacturer of north India.
Designed and developed an accounting software package for sporting LTD.
Ludhiana.
Developed a hospital Management System for a group of hospitals located in
Jalandhar viz. Sanjivani Hospital, Navjeevan Hospital
Designing and developing an in-house software IMMS integrated
manufacturing management system for manufacturing industries
incorporating the following functions:
• Financial Management
• Inventory management
• Store and purchase
• Human Resource management
11
NIC, CHANDIGARH
The Haryana State Unit was set up in the year 1988 and ever since, it has been
providing unstained IT support to the State Government. During the formulation of
the recent Action Plan, it has been decided by the Government to accord the highest
priority to the IT sector and this has given a big opportunity to NIC Haryana in
implementing its e- governance policies effectively in the State. As an important step,
a Secretariat for Information Technology has been setup at the Haryana Civil
Secretariat and Chief Minister has dedicated a special “Center for e-governance”. The
NIC center in Chandigarh Civil Secretariat is functioning since 1992. This center
works for the Control and Management, Application Development & Management,
Internet/E-mail and Web servers Management and Data Management.
12
NIC Services
Consultancy/guidance
Software Design & Development
Networking
Internet Services
WWW hosting Services
Video Conferencing
Multimedia
Geographical Information System (GIS)
Bibliographic Informatics
♦ MEDLARS
♦ Patent Information
♦ Web Services
The former chief minister of Haryana inaugurated another Intranet web server with
NAI DISHA services on 16th Dec 2001. NAI DISHA is an IT driven electronic
interface between the Government and Citizen. It is a step towards making
government services available to citizen any time, anywhere. Neither the time of the
day nor location hinder from obtaining information from the Government.
Readdressal of grievances, or even the procedure of getting a driving license or
13
getting a vehicle registered, is an easy as inquiring about the bus timing for different
destination.
NAI DISHA is the first product of District minimum agenda program (D-
MAP)/District Network (D-NET). About 25 services of public importance are already
incorporated into it. More services and databases would be added with the passage of
time.
14
15
Overview of Project
On the basis of analysis the following objectives are framed in order to achieve
the required goals :-
16
Problem Listing
The software uses concepts of C++, hence doing all the tasks like Data Hiding,
Data encapsulation, etc. the data or information about the customers within the
bank is saved to files by using FILE HANDLING property of C++.
The software provides a user friendly environment to the DBA and helps him/her
to enter the information properly, without any difficulty and then store it on files.
17
18
Initial Study
Introduction
The project “Manage - All” has been implemented to create, close, modify the
accounts regarding customers of a bank in a proper and safe manner. It can also
calculate the interest, see the transacation of an individual account. The main
objective of this project is to resolve the problems which a person faces regarding
information about its account.
There is a Data Base Administrator, who enters all the information about an
individual customer who as an account or wants to create,close,modify an account on
to the system and allows it to get stored at proper location using file handling.
There are various tasks of entering, editing and managing customer account. To do
these tasks every organization hires a Data Base Administrator. But he/she who plays
the role of DBA can never to this task manually. This is because, there is very large
number of customers who have an account in bank and there are very large fields of
information related with a single customer. So, if we consider the whole scenario, we
will come to know that it is a very complex and difficult task which can never be done
19
manually. So, in order to remove this problem, we use computers to store the data.
The data in computer is stored with the help of SOFTWARE.
This project provides the DBA all those services, which he/she requires while
managing the database.
The software provides a user friendly environment to the DBA and helps him/her to
enter the information properly, without any difficulty and then store it on files.
The software uses concepts of C++, hence doing all the tasks like Data Hiding, Data
encapsulation, etc. the data or information about the customer within a bank is saved
to files by using FILE HANDLING property of C++.
The data stored on file is not understandable to any human, it is written in machine
language which can only be interpreted by a computer. Hence, it also provides
security from unwanted access to the data.
20
TECHNOLOGY USED IN THE PROJECT
C++ Description
History
Stroustrup began work on C with Classes in 1979. The idea of creating a new
language originated from Stroustrup's experience in programming for his Ph.D. thesis
In 1980 the name was C with classes but after that in 1983, the name of the language
was changed from C with Classes to C++. C++ is an extension of language C because
new features were added in C that’s why he name as C++ means C with an increment
operator. New features that were added to the language included virtual functions,
function name and operator overloading, references, constants, user-controlled free-
store memory control, improved type checking, and a new comment style (//).
According to Stroustrup: "the name signifies the evolutionary nature of the changes
from C".
Old problems
Traditionally, C++ compilers have had a range of problems. The C++ standard does
not cover implementation of name decoration, exception handling, and other
implementation-specific features, making object code produced by different compilers
incompatible; there are, however, 3rd-party standards for particular machines or
operating systems which attempt to standardize compilers on those platforms (for
example C++ ABI[2]), and now many compilers have adopted a secondary standard
21
for these items.
Future development
Philosophy
Bjarne Stroustrup describes some rules that he uses for the design of C++.
*C++ is designed to give the programmer choice, even if this makes it possible for
the programmer to choose incorrectly
*C++ avoids features that are platform specific or not general purpose
*C++ does not incur overhead for features that are not used
C++ introduces many features that are not available in C— C++ code is not valid C
code
22
One commonly encountered differences is that C allows a void* pointer to be
assigned to any pointer type without a cast, whereas C++ does not; this idiom appears
often in C code using malloc memory allocation.
Another portability issue from C to C++ are the numerous additional keywords that
C++ introduced. This makes C code that uses them as identifiers invalid in C++.
There are many other C syntaxes which are invalid or behave differently in C++ :
• The comma operator can result in an "l-value" (a quantity that can be used for
the left-hand side of an assignment) in C++, but not in C.
• C does not allow a given typedef to be duplicated in the same scope, whereas
C++ allows redundant typedefs.
• In both C and C++ one can define nested struct types, but the scope is
interpreted differently (in C++, a nested struct is defined only within the
scope/namespace of the outer struct).
In order to intermix C and C++ code, any C++ functions which are to be called from
C-compiled code must be declared as extern "C".
23
Language features
*Operators
*Objects
*Encapsulation
*Inheritance
*Polymorphism
*Operator overloading
*Function overloading
*Criticism
C++ has been the subject of much debate. Some of the most commonly levelled
criticisms include:
• Since C++ is based on, and largely compatible with, C, it also inherits most of
the criticisms levelled at that language.
• It is extremely difficult to write a good C++ parser .This is partly because the
C++ grammar is not LALR(1). Because of that, there are very few tools for
analyzing or performing non-trivial transformations (e.g., refactoring) of
existing code.
24
bring unnecessarily advanced or complicated solutions to simple problems.
25
C++ Glossary:
A
arguments, function - Arguments in function declarations may have names, but the
names are ignored (they are positional). In C++ (unlike C), an empty argument list
means a function with no arguments, since the C "wild card" style would prevent
type-checking, e.g., int func2(); this behavior is different than the result you would
have expected in C.
B
Base class - The most generalized class in a class structure. Most applications have
many such root classes. Some languages define a primitive base class, which serves as
the ultimate superclass of all classes.
C
Character constant - single byte char enclosed by single quotes.
Class - An abstract data type. A keyword which defaults a struct class to private. A
class binds into one unit the data structure and its functions, also called a user-defined
type. Variables, or instances of that class, are called objects.
26
D
Declaration -
specifies to the compiler the types of all the elements of an identifier; "this function or
this piece of data exists somewhere else, and here is what it should look like."
Declarations normally go in header files with extensions of .h.
Derived objects receive their own copies of called base object members. The compiler
automatically calls constructors and destructors for called copies.
E
Extern - keyword in C and C++ to help tell the compiler or user how to distinguish a
definition from a declaration, when the definition is elsewhere, e.g.,
F
Friend - keyword designating a class or single member function as having access to
(1) a specified entire class, (2) a member function of another class, or (3) a designated
nonmember function. If a friend declaration omits function's parameters, compiler
checks for functions or overloaded functions with matching signatures, else reports
error.
27
function declaration - in C and C++, gives the function name, the argument types
passed to a function, and the return type of the function; e.g.,
The arguments in the function definition must have names if you also want to use the
arguments in the function body; otherwise, they are optional.
28
I
Inheritance - A C++ property which allows the defining of one class in terms of
another. The compiler physically implements inheritance by making a copy of the
data structure of the original base class into a declared derived class, and providing
access to the member functions ion the base class. Inheritance allows you to add or
modify members without corrupting the original class code. Conserves effort, and
creates extensible programs through sub classing.
Inline function - keyword forcing compiler to copy body of a called function into
the calling function. Best for recursive and loop calls. Provides type safety and side-
effects protection not afforded by #define.
L
Lvalue - "An lvalue is an expression referring to an object ... an object is a named
region of storage" . The left-hand side of the assignment operator (=) equation; what
the rvalue is copied into.
M
Manipulators - special iostream functions permitting specific i/o operations while
in the middle of stream insertion or extraction. These functions switch appropriate
iostream format flags.
O
Object - a named region of storage (whether it has yet been allocated or not).
29
P
Pointers vs. references (USG) - a pointer must be dereferenced to access what
it points to; a reference need not be. The entity to which a reference refers may only
be set when the reference is created; in this respect it is somewhat like a const pointer
that gets a virtual * put in front of it when it is used, and puts a virtual ampersand in
front of the expression from which it is initialized.
Polymorphism - lets you use objects of different classes by means of the same
program element (CRS); use of identical interfaces with different implementations
(CIO p.18). A program designed around polymorphism manages a collection of base-
class objects, and the precise result of a message sent to one of these cannot be
determined at compile time, since only the base class is known, not the subclass.
Polymorphism is the proper behavior of a derived-class object when treated as a base-
class object .. The specific function called is determined at run time.
S
Scope - Generally, the domain of objects and calls within which an object can exist.
A struct name or enum in an inner scope can obscure a global of the same name in an
outer scope. In C++, enum constants embedded in a struct def have the same scope as
that struct's fields.
Scope resolution operator (::) - operator telling compiler to look outside the
current block for variable of the same name (e.g., a global, or a member function of a
base class.)
Static member - like a global variable whose scope is limited to the class in which
it is declared. Especially true if declared as private or protected.
Static data member - shared by all objects of a class for each instantiation of that
template class. All static data members are defined within the scope of the file in
which they exist, by prefixing the definition with a template specification. The def
30
should appear in that .cp file, not in the header. Like globals, automatically initialized
to 0.
Static member function - a member function declared as static; can access and
modify static data members; cannot be of type const or virtual.
31
32
CODING USED IN THE PROJECT
int scan; // To hold the special characters for moving the prompt in menu
int ascii;
public:
void normalvideo(int x,int y,char *str);
void reversevideo(int x,int y,char *str);
void box(int x1,int y1,int x2,int y2);
33
char menu();
void control_menu();
char e_menu();
void edit_menu();
void help(void);
};
private:
void modify_account(int, char t_name[30], char t_address[30]); //
Function to modify the customer account
int accno;
char name[30], address[30];
float balance;
};
34
class account
{
public:
void new_account(void); // Function to create a new account
void close_account(void); // Function to close an account
void display_account(void); // Function to display the accounts
void transaction(void); // To display the transaction process
void clear(int, int); // Function to perform a clear screen function
void month_report(void); // Function to list monthWise transaction
report
private:
void add_to_file(int, int, int, int, char, char t_type[10], float, float,
float); // Function to add transaction records
void delete_account(int); // Function to delete a transaction record
int no_of_days(int, int, int, int, int, int); // Function to find the total
days
float calculate_interest(int, float); // Function for calculating interest of
an account
void display(int); // Function to display a transaction account
void box_for_display(int); // Function for displaying box
int accno;
char type[10]; // Account type as Cheque or Cash
int dd, mm, yy; // To store the system date/ Enter date
char tran; // As the account type is Deposit or
Withdraw
float interest, amount, balance;
};
// Function to displays all the menu prompt messages from the pointer array of option
a[]
void main_menu::normalvideo(int x,int y,char *str)
{
gotoxy(x,y);
cprintf("%s",str);
}
// Function to move the cursor on the menu prompt with a reverse video color
void main_menu::reversevideo(int x,int y,char *str)
{
textcolor(5+143);
textbackground(WHITE);
gotoxy(x,y);
cprintf("%s",str);
textcolor(GREEN);
textbackground(BLACK);
}
35
{
for(int col=x1;col<x2;col++)
{
gotoxy(col,y1);
cprintf("%c",196);
gotoxy(col,y2);
cprintf("%c",196);
}
for(int row=y1;row<y2;row++)
{
gotoxy(x1,row);
cprintf("%c",179);
gotoxy(x2,row);
cprintf("%c",179);
}
gotoxy(x1,y1);
cprintf("%c",218);
gotoxy(x1,y2);
cprintf("%c",192);
gotoxy(x2,y1);
cprintf("%c",191);
gotoxy(x2,y2);
cprintf("%c",217);
}
char main_menu::menu()
{
clrscr();
textcolor(22);
box(20, 6, 65, 20);
box(18, 4, 67, 22);
textcolor(5+143);
gotoxy(36, 5);
textbackground(BLUE);
cprintf("B A N K I N G");
textbackground(BLACK);
textcolor(22);
for(i = 1; i < 7; i++)
normalvideo(32, i+10, a[i]);
reversevideo(32, 10, a[0]);
i = done = 0;
_setcursortype(_NOCURSOR);
do
{
int key = getch();
switch (key)
{
case 00:
36
key = getch();
switch (key)
{
case 72:
normalvideo(32, i+10, a[i]);
i--;
if (i == -1)
i = 6;
reversevideo(32,i+10,a[i]);
break;
case 80:
normalvideo(32, i+10, a[i]);
i++;
if (i == 7)
i = 0;
reversevideo(32, i+10, a[i]);
break;
}
break;
case 13:
done = 1;
}
}
while (!done);
_setcursortype(_NOCURSOR);
return(i+49);
}
/* The function main_menu() is used to display the main menu of banking system */
void main_menu::control_menu()
{
char choice;
account a;
do
{
choice = menu();
clrscr();
switch (choice)
{
case '1':
_setcursortype(_NORMALCURSOR);
box(3, 1, 75, 24);
box(5, 2, 73, 23);
37
box(5, 2, 73, 23);
initial ini;
ini.display_list(); // Glogal list of account function
break;
case '3':
box(3, 1, 75, 24);
box(5, 2, 73, 23);
_setcursortype(_NORMALCURSOR);
a.display_account(); // Displaying individual accounts
all transactions
break;
case '4':
box(3, 1, 75, 24);
box(5, 2, 73, 23);
account a;
_setcursortype(_NORMALCURSOR);
a.transaction(); // Daily transaction for individual
account
break;
case '5':
box(3, 1, 75, 24);
box(5, 2, 73, 23);
_setcursortype(_NORMALCURSOR);
a.month_report(); // Monthly report for any account
break;
case '6':
box(3, 1, 75, 24);
box(5, 2, 73, 23);
gotoxy(10,10);
edit_menu(); // Sub menu for modifying or deleting any
account
break;
case '7' :exit(0);
}
} while (choice != 6);
}
char choice;
account a;
do
{
38
choice = e_menu();
clrscr();
switch (choice)
{
case '1':
box(3, 1, 75, 24);
box(5, 2, 73, 23);
initial ini;
_setcursortype(_NORMALCURSOR);
ini.modify();
break;
case '2':
box(3, 1, 75, 24);
box(5, 2, 73, 23);
account a;
_setcursortype(_NORMALCURSOR);
a.close_account();
break;
case '3':
return;
}
} while (choice != 6);
}
39
char l1 = 196, l2 = 179;
if (c == ch)
{
c1 = 218;
c2 = 191;
c3 = 217;
c4 = 217;
l1 = 196;
l2 = 179;
}
else
{
c1 = c;
c2 = c;
c3 = c;
c4 = c;
l1 = c;
c2 = c;
}
gotoxy(column1, row1);
cout << c1;
gotoxy(column2, row1);
cout << c2;
gotoxy(column1, row2);
cout << c3;
gotoxy(column2, row2);
cout << c4;
column1++;
column2--;
line_hor(column1, column2, row1, l1); //Horizontal line
line_hor(column1, column2, row2, l1);
column1--;
column2++;
row1++;
row2--;
line_ver(row1, row2, column1, l2); // Vertical line
line_ver(row1, row2, column2, l2);
}
setbkcolor(7);
settextstyle(7,HORIZ_DIR,5);
outtextxy(70,20,"Welcome to Banking Project");
settextstyle(2,HORIZ_DIR,5);
40
outtextxy(60,100, "This project your can keep record of daily banking
transaction");
delay(2);
outtextxy(60,130, "This program is capable of holding any no. of account.");
delay(2);
outtextxy(60,160, "-In first option you can open new account");
delay(2);
outtextxy(60,190, "-In second option you can see the list of all the accounts");
delay(2);
outtextxy(60,220,"-In third option you can see all the transaction of individual
account");
delay(2);
outtextxy(60,250, "-Through fourth optiion you can do banking transactions");
delay(2);
outtextxy(60,280, "(Deposit/Withdraw)");
delay(2);
outtextxy(60,310, "-In fifth option you can take monthWise individual account
report");
delay(2);
outtextxy(60,340,"-In sixth option you can modify or delete any account");
delay(2);
outtextxy(60,370, "Note-: Opening amount should not less that Rs. 500/-");
delay(2);
outtextxy(60,400, "-And last option is Quit (Exit to Window)");
delay(2);
settextstyle(7,HORIZ_DIR,4);
outtextxy(80,420,"Press any key to continue...");
getch();
41
{
gotoxy(5, 5);
cout << "\7Account not found";
getch();
return;
}
gotoxy(71, 1);
cout << "<0>=Exit";
textbackground(WHITE);
gotoxy(3, 3);
for (j = 1; j<= 76; j++)
cprintf(" ");
textbackground(BLACK);
textcolor(BLACK+BLINK);
textbackground(WHITE);
gotoxy(30, 3);
cprintf("Modify Account Screen");
textcolor(LIGHTGRAY);
textbackground(BLACK);
int d1, m1, y1;
struct date d; // For extracting system date
getdate(&d);
d1 = d.da_day;
m1 = d.da_mon;
y1 = d.da_year;
gotoxy(4, 2);
cout << "Date: " << d1 << "/" << m1 << "/" << y1;
char ch;
display(t_accno);
account a;
do
{
a.clear(5, 13);
gotoxy(5, 13);
cout << "Modify this account <y/n>: ";
ch = getche();
if (ch == '0')
return;
ch = toupper(ch);
}while (ch != 'N' && ch != 'Y');
if (ch == 'N')
return;
int modified = 0, valid;
char t_name[30], t_address[30];
gotoxy(5, 15);
cout << "Name : ";
gotoxy(5, 16);
cout << "Address : ";
do
42
{
a.clear(15, 15);
a.clear(5, 23);
gotoxy(5, 23);
cout << "Enter Name or Press Enter for No Change";
valid = 1;
gotoxy(15, 15);
gets(t_name);
strupr(t_name);
if (t_name[0] == '0')
return;
if (strlen(t_name) > 25)
{
valid = 0;
gotoxy(5, 23);
cprintf("\7Name should not greater than 25");
getch();
}
} while (!valid);
do
{
a.clear(15, 16);
a.clear(5, 23);
gotoxy(5, 23);
cout << "Enter Address or press enter for no Change";
valid = 1;
gotoxy(15, 16);
gets(t_address);
strupr(t_address);
if (t_address[0] == '0')
return;
if (strlen(t_address) > 25)
{
valid = 0;
gotoxy(5, 23);
cprintf("\7Address should not greater than 25");
getch();
}
}while (!valid);
if (strlen(t_address) > 0)
modified = 1;
if (!modified)
return;
// clears the screen at 23rd row and from 5th column
a.clear(5,23);
do
{
43
a.clear(5, 23);
gotoxy(5, 18);
cout << "Do you want to save Changes <Y/N>: ";
ch = getche();
if (ch == '0')
return;
ch = toupper(ch);
}while (ch != 'N' && ch != 'Y');
if (ch == 'N')
return;
/* This function add_to_file() is used to create new/fresh record in the data file */
void initial::add_to_file(int t_accno, char t_name[30], char t_address[30], float
t_balance)
{
accno = t_accno;
strcpy(name, t_name);
44
strcpy(address, t_address);
balance = t_balance;
fstream file;
// Appends new account record with the balance into INITIAL.dat data file
file.open("INITIAL.dat", ios::out|ios::app);
file.write((char *)this, sizeof(initial));
file.close();
}
// Uses a copy method to delete the account from INTITAL.dat data file
while (!file.eof())
{
file.read((char *)this, sizeof(initial));
if (file.eof())
break;
if (accno != t_accno)
temp.write((char *)this, sizeof(initial));
}
file.close();
temp.close();
file.open("INITIAL.dat", ios::out);
temp.open("TEMP.dat", ios::in);
temp.seekg(0, ios::beg);
45
{
clrscr();
int flag;
float t_bal = 0.0;
fstream file;
gotoxy(25,2);
gotoxy(1, 5);
cout << "Accno#";
gotoxy(10,5);
cout << "Name";
gotoxy(30,5);
cout << "Address";
gotoxy(65,5);
cout << "Balance";
gotoxy(1, 6);
for (j = 1; j <= 79; j++)
cout << "=";
file.open("INITIAL.dat", ios::in);
file.seekg(0,ios::beg);
int row = 7;
46
/* Function to found an account for display account function. */
int initial::found_account(int t_accno)
{
fstream file;
file.open("INITIAL.dat", ios::in);
file.seekg(0, ios::beg);
int found = 0;
initial ini;
char t_name[30];
strcpy(t_name, ini.return_name(t_accno));
char t_address[30];
strcpy(t_address, ini.return_address(t_accno));
gotoxy(25, 2);
cout << t_name;
gotoxy(25, 3);
cout << t_address;
gotoxy(4, 5);
47
cout << "Global Report of Account";
textbackground(WHITE);
textcolor(BLACK);
textbackground(WHITE);
gotoxy(1, 6);
for (int i = 1; i <=79; i++)
cout << "=";
gotoxy(4, 7);
cprintf("Date Particular Deposit Withdraw Balance");
gotoxy(1, 8);
for (i = 1; i <=79; i++)
cout << "=";
textcolor(LIGHTGRAY);
textbackground(BLACK);
}
48
initial ini;
if (!ini.found_account(t_accno))
{
gotoxy(5, 5);
cout << "\7Account not found";
getch();
return;
}
box_for_display(t_accno);
gotoxy(4, 5);
cout << "Statement Month: " << dd1 << "/" << mm1 << "/" << yy1;
getch();
file.close();
file.open("BANKING.dat", ios::in);
gotoxy(54, row);
// The loop displays the current months transaction after previous month
while (file.read((char *)this, sizeof(account)))
{
if ((accno == t_accno) && (mm1 == mm && yy1 <= yy))
{
flag = 0;
delay(2);
gotoxy(4, row);
49
cout << dd << "-" << mm << "-" << yy;
gotoxy(16, row);
puts(type);
if (tran == 'D')
{
damt = damt + amount;
tamt = tamt + amount;
gotoxy(30, row);
}
else
{
wamt = wamt + amount;
tamt = tamt - amount;
gotoxy(42, row);
}
gotoxy(66, row);
cout << setw(15)
<< setprecision(2)
<< setiosflags(ios::left)
<< setiosflags(ios::showpoint)
<< setiosflags(ios::fixed)
<< balance;
row++;
50
gotoxy(4, row);
cout << "Total-->:";
gotoxy(30, row);
// Deposited amount
cout << setw(15) // setwidth
<< setprecision(2) // set position of decimal point
<< setiosflags(ios::left) // set left justified output
<< setiosflags(ios::showpoint) // always show decimal point
<< setiosflags(ios::fixed) // set fixed notation for display
<< damt;
gotoxy(42, row);
// Withdraw amount
cout << setw(15)
<< setprecision(2)
<< setiosflags(ios::left)
<< setiosflags(ios::showpoint)
<< setiosflags(ios::fixed)
<< wamt;
gotoxy(66, row);
tamt = tamt + pre_balance;
// Balance amount
cout << setw(15)
<< setprecision(2)
<< setiosflags(ios::left)
<< setiosflags(ios::showpoint)
<< setiosflags(ios::fixed)
<< tamt;
if (!flag)
{
gotoxy(4, 24);
cout << "Press any key to continue...";
getch();
}
shape s;
51
s.box(2, 1, 79, 25, 218);
s.box(25, 2, 54, 4, 219);
gotoxy(65, 2);
cout << "<0>=Exit";
gotoxy(3,3);
for (i = 1; i<= 76; i++)
cprintf(" ");
textbackground(BLACK);
textcolor(BLACK+BLINK);
textbackground(WHITE);
gotoxy(30, 3);
cprintf("Open New Account");
textcolor(LIGHTGRAY);
textbackground(BLACK);
int d1, m1, y1;
struct date d; // For extracting system date
getdate(&d);
d1 = d.da_day;
m1 = d.da_mon;
y1 = d.da_year;
int t_accno;
t_accno = ini.last_accno();
t_accno++;
// Appends and deletes a false record to create primary position in data files
if (t_accno == 1)
{
ini.add_to_file(t_accno, "abc", "xyz", 1.1);
ini.delete_account(t_accno);
cout << "Prese xxxxxxx";
getch();
add_to_file(t_accno, 1, 1, 1997, 'D', "INITIAL", 1.1, 1.1, 1.1);
delete_account(t_accno);
}
char t_name[30], t[10], t_address[30];
float t_bal = 0.0, t_balance = 0.0;
gotoxy(5, 6);
cout << "Date: " << d1 << '/' << m1 << '/' << y1;
gotoxy(5, 8);
cout << "Account No # " << t_accno;
gotoxy(5, 10);
cout << "Name : ";
gotoxy(5, 11);
cout << "Address : ";
gotoxy(5, 12);
cout << "Name of verifying Person : ";
gotoxy(5, 14);
cout << "Initial Deposit : ";
52
do
{
clear(15, 10);
clear(5, 23);
gotoxy(5, 23);
cout << "Enter Name of the Person";
valid = 1;
gotoxy(15, 10);
gets(t_name);
strupr(t_name);
if (t_name[0] == '0')
return;
if (strlen(t_name) == 0 || strlen(t_name) > 25)
{
valid = 0;
gotoxy(5, 23);
cprintf("\7Name should not greater than 25");
getch();
}
}while (!valid);
do
{
clear(25, 15);
clear(5, 23);
gotoxy(5, 23);
cout << "Enter Address of the Person ";
valid = 1;
gotoxy(15, 11);
gets(t_address);
strupr(t_address);
if (t_address[0] == '0')
return;
if (strlen(t_address) == 0 || strlen(t_address) > 25)
{
valid = 0;
gotoxy(5, 23);
cprintf("\7Address should not greater than 25");
getch();
}
}while (!valid);
do
{
char vari[30];
clear(13, 12);
clear(5, 23);
gotoxy(5, 23);
cout << "Enter name of the varifying Person ";
valid = 1;
53
gotoxy(31, 12);
gets(vari);
strupr(vari);
if (vari[0] == '0')
return;
if (strlen(vari) == 0 || strlen(vari) > 25)
{
valid = 0;
gotoxy(5, 23);
cprintf("Should not blank or greater than 25");
getch();
}
}while (!valid);
do
{
clear(13, 12);
clear(5, 23);
gotoxy(5, 23);
cout << "Enter initial amount to be deposit ";
valid = 1;
gotoxy(23, 14);
gets(t);
t_bal = atof(t);
t_balance = t_bal;
if (t[0] == '0')
{
valid = 0;
gotoxy(5, 23);
cprintf("\7Should not less than 500");
getch();
}
}while (!valid);
clear(5, 23);
do
{
clear(5, 17);
valid = 1;
gotoxy(5, 17);
cout << "Do you want to save the record <Y/N>: ";
ch = getche();
if (ch == '0')
return;
ch = toupper(ch);
}while (ch != 'N' && ch != 'Y');
if (ch == 'N')
return;
float t_amount, t_interest;
54
t_amount = t_balance;
t_interest = 0.0;
char t_tran, t_type[10];
t_tran = 'D';
strcpy(t_type, "INITIAL");
55
return count;
}
/* Function for updating the balance for the given account no. */
void initial::update_balance(int t_accno, char t_name[30], char t_address[30], float
t_balance)
{
int recno;
recno = recordno(t_accno);
fstream file;
file.open("INITIAL.dat", ios::out|ios::ate);
strcpy(name, t_name);
strcpy(address, t_address);
balance = t_balance;
int location;
location = (recno-1) * sizeof(initial); // Find the location in file
file.seekp(location); // Searches the insertion position in data file
56
days = no_of_days(d1, m1, y1, d2, m2, y2);
int months = 0;
if (days > 30)
{
months = days / 30;
t_interest = ((t_balance*2)/100 * months);
}
file.close();
return t_interest;
}
57
d1 = d.da_day;
m1 = d.da_mon;
y1 = d.da_year;
gotoxy(5, 6);
cout << "Date: " << d1 << "/" << m1 << "/" << y1;
gotoxy(5, 8);
cout << "Accnount no. " << t_accno;
char t_name[30];
char t_address[30];
float t_balance;
strcpy(t_name, ini.return_name(t_accno));
strcpy(t_address, ini.return_address(t_accno));
t_balance = ini.give_balance(t_accno);
gotoxy(27, 11);
cout << "Name : " << t_name;
gotoxy(27, 12);
cout << "Address : " << t_address;
gotoxy(5, 15);
cout << "Last balance Rs. " << setw(15)
<< setprecision(2)
<< setiosflags(ios::left)
<< setiosflags(ios::showpoint)
<< setiosflags(ios::fixed)
<< t_balance;
do
{
clear(5, 10);
valid = 1;
gotoxy(5, 10);
cout << "Deposit or Withdraw (D/W) : ";
t_tran = getch();
if (t_tran == '0')
return;
t_tran = toupper(t_tran);
}while (t_tran != 'D' && t_tran != 'W');
do
{
clear(5, 19);
clear(5, 23);
gotoxy(5, 23);
cout << "Enter Transaction by Cash or Cheque ";
valid = 1;
gotoxy(5, 19);
cout << "Cash/Cheque : ";
58
gets(t_type);
strupr(t_type);
if (t_type[0] == '0')
return;
if (strcmp(t_type, "CASH") && strcmp(t_type, "CHEQUE"))
{
valid = 0;
gotoxy(5, 23);
cprintf("\7Enter correctly");
getch();
}
}while (!valid);
do
{
clear(5, 21);
clear(5, 23);
gotoxy(5, 23);
cout << "Enter Amount for Transaction ";
valid = 1;
gotoxy(5, 21);
cout << "Amount Rs. ";
gets(tm);
t_amt = atof(tm);
t_amount = t_amt;
if (tm[0] == '0')
return;
if ((t_tran == 'W' && t_amount > t_balance) || (t_amount < 1))
{
valid = 0;
gotoxy(5, 23);
cprintf("\7Invalid Data entered");
getch();
}
}while (!valid);
char ch;
clear(5, 23);
do
{
clear(20, 23);
valid = 1;
gotoxy(40, 20);
cout << "Save Transaction <Y/N> : ";
ch = getche();
if (ch == '0')
return;
ch = toupper(ch);
}while (ch != 'N' && ch != 'Y');
if (ch == 'N')
59
return;
float t_interest;
if (t_tran == 'D')
t_balance = t_balance + t_amount + t_interest;
else
t_balance = (t_balance - t_amount) + t_interest;
60
cprintf("Close account screen");
textcolor(LIGHTGRAY);
textbackground(BLACK);
int d1, m1, y1;
struct date d;
getdate(&d);
d1 = d.da_day;
m1 = d.da_mon;
y1 = d.da_year;
gotoxy(5, 6);
cout << "Date: " << d1 << "/" << m1 << "/" << y1;
char ch;
ini. display(t_accno);
do
{
clear(5, 15);
gotoxy(5, 15);
cout << "Close this account <y/n?? ";
ch = getche();
if (ch == '0')
return;
ch = toupper(ch);
}while (ch != 'N' && ch != 'Y');
if (ch == 'N')
return;
// Main program logic which control the class members and member functions.
void main(void)
{
main_menu m_menu;
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, "");
m_menu.help();
closegraph();
m_menu.control_menu();
}
61
OUTPUTS
The Main Menu looks like this:-
The new account is created. After creating new account we will return into main
menu
62
It will open the list of accounts which are already created
63
In the account we will get this screen
64
In daily trans this screen will open:-
This screen will tell about the daily transaction which take place.
65
By clicking on monthly report,the report will be generated
66
We can edit the account using:-
Modify Account
Close Account
67
By Quit we will reach in Main menu
68
By exit we will exit from main menu
69