computer investigatory report on "Bank System"

16

description

computer investigatory report on "Bank System"

Transcript of computer investigatory report on "Bank System"

Page 1: computer investigatory report on "Bank System"
Page 2: computer investigatory report on "Bank System"

PROJECT GUIDE

MR. KAPIL SAINI

{SUBJECT TEACHER}

SUBMITTED FROM

SAMYAK SAU

{ Xii TH ‘A’ (Sc.) }

Roll no.

Page 3: computer investigatory report on "Bank System"

Mr. Kapil Saini

(Lecturer in Comp. Sc.)

This to certify that the project report entitled “BANK SYSTEM” submitted by SAMYAK SAU during the academic year 2010 – 2011 is a bonafied piece of work conducted under my supervision and guidance. The data sources have been dully acknowledged.

I wish his success in all his future endeavours.

Mr. P.C Prashar

(Principal)

Supervised by:

Page 4: computer investigatory report on "Bank System"

I take this opportunity to express my profound sense of gratitude and respect to all those who helped me throughout this venture.

I owe my regards to Mr. P.C Prashar, Principal K.V No.1 (AFS) Pathankot for his cooperation and valuable support and for giving me the opportunity to undertake this project work and providing the necessary infrastructure.

I would like to express my heartfelt thanks to my revered teacher and guide Mr. Kapil Saini for his valuable guidance, encouragement and support throughout my studentship under him at the institute. This project is his visualization and owes a lot of its functionality to him.

Last but not the least; I owe my overwhelming gratitude to my family and friends who gave me constant support and motivation to continue with this endeavour.

SAMYAK SAU XII ‘A’

Mr. P.C Prashar

(Principal)

Page 5: computer investigatory report on "Bank System"

The computers have gained a lot of importance in the past five decades. Most of our day-to-day jobs are being influenced by the use of computers. Now a day, computers are used for performing almost every function, which were performed by humans in the past. In some areas such as science and technology, targets can’t be achieved without the use of computers. The characteristics the make the computer so important includes its extra ordinary speed, large storage capacity, accuracy and consistency.

Today computers play a great role in various industries and a large numbers of industries are using computer for various applications such as maintaining cashbook, sales book, purchase book, and other books of accounts. Computer can also be used for the designing of the various products. Computers provide many options for the designing of products.

In this project report, steps have been taken for computerizing Bank Management System. The analysis of the project has been

Page 6: computer investigatory report on "Bank System"

undertaken with utmost sincerity and honesty and we will be extremely satisfied if the effort is appreciated.

Page 7: computer investigatory report on "Bank System"
Page 8: computer investigatory report on "Bank System"

Developed At: - Kendriya Vidyalaya no.1 (AFS), Pathankot

Affiliated to CENTRAL BOARD OF SECONDARY EDUCATION New Delhi.

//PROGRAM TO MAINTAIN THE BANK SYSTEM//***************************************************************// HEADER FILE USED IN PROJECT//***************************************************************#include<iostream.h>#include<conio.h>#include<stdio.h>#include<process.h>#include<fstream.h>#include<ctype.h>#include<string.h>//***************************************************************// CLASS USED IN PROJECT//***************************************************************

Tools Used

Front end: - C++

Page 9: computer investigatory report on "Bank System"

class account{

int acno;char name[50];int deposit, withdraw;char type;

public:

void create_account(){

cout<<"\nEnter The account No."; cin>>acno; cout<<"\n\nEnter The Name of The account Holder "; gets(name); cout<<"\nEnter Type of The account (C/S) "; cin>>type; type=toupper(type); cout<<"\nEnter The Initial amount(>=500 for Saving and >=1000 for current )"; cin>>deposit; cout<<"\n\n\nAccount Created..";

}

void show_account(){

cout<<"\nAccount No. : "<<acno; cout<<"\nAccount Holder Name : "; puts(name); cout<<"\nType of Account : "<<type; cout<<"\nBalance amount : "<<deposit;

}

void modify_account(){

cout<<"\nAccount No. : "<<acno; cout<<"\nModify Account Holder Name : "; gets(name); cout<<"\nModify Type of Account : ";cin>>type; cout<<"\nModify Balance amount : ";cin>>deposit;

}

void dep(int x){ deposit+=x;}

void draw(int x){ deposit-=x;}

void report(){cout<<acno<<"\t"<<name<<"\t\t"<<type<<"\t\t"<<deposit<<endl;}

int retacno(){return acno;}float retdeposit() {return deposit;}

char rettype(){return type;}

}; //***************************************************************

Page 10: computer investigatory report on "Bank System"

// GLOBAL DECLARATION FOR STREAM OBJECT//*************************************************************** fstream fp; account ac;//***************************************************************// FUNCTION TO WRITE IN FILE//***************************************************************void write_account() { fp.open("account.dat",ios::out|ios::app);ac.create_account();

fp.write((char*)&ac,sizeof(account));fp.close(); }//***************************************************************// FUNCTION TO READ SPECIFIC RECORD FROM FILE//***************************************************************void display_sp(int n){clrscr();cout<<"\nBALANCE DETAILS\n";int flag=0;fp.open("account.dat",ios::in);while(fp.read((char*)&ac,sizeof(account)))

{if(ac.retacno()==n){

ac.show_account();flag=1;

}}

fp.close();if(flag==0)cout<<"\n\nAccount number does not exist";

getch();}

//***************************************************************// FUNCTION TO MODIFY RECORD OF FILE//***************************************************************

void modify_account(){int no,found=0;

clrscr();cout<<"\n\n\tTo Modify ";cout<<"\n\n\tEnter The account No. of The account";cin>>no;

fp.open("account.dat",ios::in|ios::out);while(fp.read((char*)&ac,sizeof(account)) && found==0)

{if(ac.retacno()==no){ ac.show_account();

cout<<"\nEnter The New Details of account"<<endl; ac.modify_account();

int pos=-1*sizeof(ac);fp.seekp(pos,ios::cur);

fp.write((char*)&ac,sizeof(account)); cout<<"\n\n\t Record Updated";

found=1;}

} fp.close();if(found==0) cout<<"\n\n Record Not Found "; getch();}

//***************************************************************// FUNCTION TO DELETE RECORD OF FILE

Page 11: computer investigatory report on "Bank System"

//***************************************************************

void delete_account(){int no;clrscr();cout<<"\n\n\n\tDelete Record";cout<<"\n\nEnter The account no. of the customer You Want To Delete";cin>>no; fp.open("account.dat",ios::in|ios::out); fstream fp2;

fp2.open("Temp.dat",ios::out); fp.seekg(0,ios::beg); while(fp.read((char*)&ac,sizeof(account)))

{if(ac.retacno()!=no){

fp2.write((char*)&ac,sizeof(account));}

} fp2.close(); fp.close(); remove("account.dat");

rename("Temp.dat","account.dat"); cout<<"\n\n\tRecord Deleted .."; getch();}

//***************************************************************// FUNCTION TO DISPLAY ALL ACCOUNTS DEPOSIT LIST//***************************************************************

void display_all(){

clrscr(); fp.open("account.dat",ios::in); if(!fp) {

cout<<"ERROR!!! FILE COULD NOT BE OPEN\n\n\n Go To Admin Menu to create File"; getch(); return; }

cout<<"\n\n\t\tACCOUNT HOLDER LIST\n\n";cout<<"====================================================\n";

cout<<"A/c no.\tNAME\t\tType\t\tBalance\n";cout<<"====================================================\n";while(fp.read((char*)&ac,sizeof(account))){

ac.report();}

fp.close();}//***************************************************************// FUNCTION TO DEPOSIT AND WITHDRAW AMOUNTS//***************************************************************void deposit_withdraw(int option){int no,found=0,amt;clrscr(); cout<<"\n\n\tEnter The account No."; cin>>no;

fp.open("account.dat",ios::in|ios::out); while(fp.read((char*)&ac,sizeof(account)) && found==0) {

if(ac.retacno()==no){ ac.show_account();

if(option==1){

cout<<"\n\n\tTO DEPOSITE AMOUNT ";

Page 12: computer investigatory report on "Bank System"

cout<<"\n\nEnter The amount to be deposited";cin>>amt;ac.dep(amt);

}if(option==2)

{cout<<"\n\n\tTO WITHDRAW AMOUNT ";cout<<"\n\nEnter The amount to be withdraw";cin>>amt;int bal=ac.retdeposit()-amt;if((bal<500 && ac.rettype()=='S') || (bal<1000 && ac.rettype()=='C'))

cout<<"Insufficience balance";else

ac.draw(amt);}

int pos=-1*sizeof(ac);fp.seekp(pos,ios::cur);fp.write((char*)&ac,sizeof(account));cout<<"\n\n\t Record Updated";found=1;

} } fp.close();

if(found==0) cout<<"\n\n Record Not Found "; getch();}//***************************************************************// PASSWORD AND USER NAME FUNCTION//***************************************************************struct administrator{

char user_name[10];char password[10];

}admin;

void assign_user(){

strcpy(admin.user_name, "sausamyak");strcpy(admin.password, "sausamyak");

}int verify_password(){

char u_name[10];char u_pwd[10],temp[2];int x=1;cout<<"\n\n Enter user name : ";cin>>u_name;cout<<"\n\n Enter Password : ";cin>>u_pwd;x=strcmp(admin.user_name,u_name);if (x==0){

x=strcmp(admin.password,u_pwd);

}cin.getline(temp,2);return(x);

}//***************************************************************// INTRODUCTION FUNCTION//***************************************************************void intro(){clrscr();

int z;cout<<"\t%% %% ";

Page 13: computer investigatory report on "Bank System"

cout<<"\n\t%% %% %%%%%%% %% %%%%%% %%%%%% %%%% %%%% %%%%%%%";cout<<"\n\t%% %% %% %% %% %% %% %% %%% %% %% ";cout<<"\n\t%% %% %% %%%%% %% %% %% %% %% %%% %% %%%%% ";cout<<"\n\t%% %% %% %% %% %% %% %% %% %% %% ";cout<<"\n\t%%%%%%%%%% %%%%%%% %%%%%%% %%%%%%% %%%%%% %% %% %%%%%%% ";cout<<"\n\n\t\t\t $$$$$$$$ $$$$$ ";cout<<"\n\t\t\t $$ $ $ ";cout<<"\n\t\t\t $$ $$$$$ ";cout<<"\n\n\n\tCOMPUTER PROJECT (******** ON BANK SYSTEM *******)";cout<<"\n\n\t\t\t\t BY :-";cout<<"\n\n\t\t\t* SAMYAK SAU "<<"\t XII-A *";cout<<" \n\n\n\t\t press any number and ‘ENTER’ to continue: ";cin>>z;

}//***************************************************************// THANKS FUNCTION//***************************************************************void thanks(){int w;clrscr();

cout<<"\n\n\n\n\n\n\n\n\n\n\t********** T H A N K Y O U F O R W O R K I N G *******";cout<<"\n\n\n\n\n\n\n\t\t\tpress any number and then ‘ENTER’ to exit";cin>>w;

}//***************************************************************// THE MAIN FUNCTION OF PROGRAM//***************************************************************void main(){ char ch;int p;

assign_user();p=verify_password();if(p==0){

intro ();}else{

cout<<"\n\tU R Not a Valid User.";cout<<"\n\tU Dont have the Authority to Access . Bye\n\n";exit(0);

}do{clrscr();

cout<<"\n\n\n\tMAIN MENU";cout<<"\n\n\t01. NEW ACCOUNT";cout<<"\n\n\t02. DEPOSIT AMOUNT";cout<<"\n\n\t03. WITHDRAW AMOUNT";cout<<"\n\n\t04. BALANCE ENQUIRY";cout<<"\n\n\t05. ALL ACCOUNT HOLDER LIST";cout<<"\n\n\t06. CLOSE AN ACCOUNT";cout<<"\n\n\t07. MODIFY AN ACCOUNT";cout<<"\n\n\t08. EXIT";cout<<"\n\n\tSelect Your Option (1-8) ";ch=getche();switch(ch){

case '1': clrscr();write_account();

getch();break;

case '2': clrscr();deposit_withdraw(1);

break;case '3': clrscr();

deposit_withdraw(2); getch();

break;

Page 14: computer investigatory report on "Bank System"

case '4': int num;clrscr();cout<<"\n\n\tEnter The account No. ";cin>>num;display_sp(num);break;

case '5': clrscr(); display_all();

getch(); break;

case '6': delete_account(); break;

case '7': clrscr();modify_account();getch();break;

case '8': thanks();exit(0);

default : cout<<"\a";}}while(ch!='8');}//***************************************************************

// END OF PROJECT//***************************************************************

Computer Science with C++

Sumita Arora

Dhanpat Rai & Co.

Computer Science

Page 15: computer investigatory report on "Bank System"

Luxmi Publications