Computer Science Project On Banking System
Computer Science Project On Banking System
Certificate..............................................2
Acknowledgement....................................3
About C++...............................................4
Introduction.............................................6
Flow chart...............................................7
Source code............................................8
Screenshots..........................................42
Page | 1
Certificate
This is to certify that Akash M.S , a student
of class XII-L has successfully completed the
research on the below mentioned project
under the guidance of Mrs. Smitha
(Computer Science Teacher) during the year
2015-16 in partial fulfillment of Computer
Science practical examination conducted by
AISSCE, New Delhi.
External examiner
Computer Science Teacher
Acknowledgement
Page | 2
About C++
Page | 3
Page | 4
Introduction
Page | 6
LOGIN
SCREEN
MAIN MENU
TRANSACTI
ON
CREATE
ACCOUNT
SEARCH &
DISPLAY
DEPOSIT
USER
DISPLAY
WITHDRAW
REPORT
LOAN
MODIFY
DELETE
ACCOUNT
Page | 7
Source code
//-----------------------------------------------------------------//***************
HEADER FILES USED
****************
//-----------------------------------------------------------------#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<process.h>
#include<math.h>
#include<fstream.h>
#include<iomanip.h>
#include<ctype.h>
//-----------------------------------------------------------------//***************
FUNCTION DECLARATIONS
****************
//-----------------------------------------------------------------void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
loading(int);
delay(float);
Jscreen(int);
screen();
clearoff(int,int,int,int,float);
caption(int,int);
logo(int,int,int,float);
press(int);
menu();
login();
Nscreen(int);
keys1();
transaction();
menu_();
keys2(int);
iaddaccount();
searchdisplay();
Page | 8
int iuserdisplay(int,int);
void ireport();
void imodify();
void impress();
int check(char[],int[],char,int[],int[],char[]);
int irandom(int,int);
void border(int,float);
void border2(int,int,int,int,float);
void beat(int,int,int,float,int);
void arrow(int);
void idepositwithdraw(int);
int keys3(int);
void iloan();
void column(int,int);
void ideleteaccount();
void verify();
Page | 9
void iaddaccount()
{
bank M;
ofstream outfile;
outfile.open("bank.dat",ios::binary|ios::app);
M.addaccount(1);
outfile.write((char *)&M,sizeof(M));
outfile.close();
menu();
}
//------------------------------------------------------------------------//****************
FUNCTION TO CREATE AN ACCOUNT
******************
//-------------------------------------------------------------------------
void bank::addaccount(int h)
{
int t=0;Jscreen(0);
o:;
if(h==1)
{
char A[20]={
'$',' ','C','R','E','A','T','E','
;
for(i=4,j=0;i<0,j<16;i++,j++)
{
gotoxy(5,i); delay(6);
cout<<A[j];
Page | 10
gotoxy(75,i);
cout<<A[j];
}
}
gotoxy(8,4);
cout<<"$Name:";
gotoxy(16,3);
cout<<"|----------------------------------------------------|";
gotoxy(16,4);
cout<<"$ $";
gotoxy(16,5);
cout<<"|----------------------------------------------------|";
gotoxy(8,7);
cout<<"$A/c No:";
gotoxy(16,6);
cout<<"|--------------------|";
gotoxy(16,7);
cout<<"$ $";//pause
gotoxy(16,8);
cout<<"|--------------------|";
gotoxy(42,7);
cout<<"$A/c Type:";
gotoxy(43,8);
cout<<"[C/S]";
gotoxy(52,6);
cout<<"|----------------|";
gotoxy(52,7);
cout<<"$ $";
gotoxy(52,8);
cout<<"|----------------|";
gotoxy(8,10);
cout<<"$Phone :";
gotoxy(9,11);
cout<<"Number";
gotoxy(16,9);
cout<<"|--------------------|";
gotoxy(16,10);
cout<<"$ $";
gotoxy(16,11);
cout<<"|--------------------|";
gotoxy(42,10);
if(h==1)cout<<"$Initial:";if(h==2)cout<<"$Modified";
gotoxy(45,11);
cout<<"Fund";
gotoxy(52,9);
cout<<"|----------------|";
gotoxy(52,10);
cout<<"$ $";
gotoxy(52,11);
cout<<"|----------------|";
gotoxy(8,13);
cout<<"$Address:";
gotoxy(16,12);
cout<<"|----------------------------------------------------|";
gotoxy(16,13);
cout<<"$ $";
gotoxy(16,14);
cout<<"|----------------------------------------------------|";
gotoxy(12,15);
cout<<"I hereby accknowledge that the above provided information";
gotoxy(12,16);
cout<<"is correct";
gotoxy(30,17);
cout<<"|----------|";
gotoxy(30,18);
cout<<"$ CLEAR $";
gotoxy(30,19);
cout<<"|----------|";
gotoxy(47,17);
cout<<"|----------|";column(3,0);gotoxy(13,22);cout<<" Press ESC to
LOGOUT Press BACKSPACE to go back";
gotoxy(47,18);if(h==1)cout<<"$ CREATE $";
if(h==2)cout<<"$ MODIFY $";
Page | 11
gotoxy(47,19);cout<<"|----------|";
if(h==2|t==1)
{
gotoxy(17,4);
cout<<name;
gotoxy(17,7);
cout<<acc;
gotoxy(17,10);
cout<<" ";
gotoxy(17,10);
cout<<"+973";
gotoxy(21,10);
cout<<tele;
gotoxy(53,7);
cout<<type;
gotoxy(53,10);
cout<<cash;
gotoxy(17,13);
cout<<address;
}
int ch,p=0; x:if(p==0)
{
{
gotoxy(49,18);cout<<" ";
gotoxy(7,4);cout<<">";
}
ch=getch();
if(ch==62||ch==46||ch==9||ch==45||ch==91)
{
if(h==1)p=1;else if(h==2)p=2;
}
else
if(ch==60||ch==44||ch==32||ch==61||ch==93)
{
p=7;
gotoxy(7,4);cout<<" ";
}
}
if(p==1)
{
{
gotoxy(7,4);cout<<" ";
gotoxy(7,7);cout<<">";
}
ch=getch();
if(ch==62||ch==46||ch==9||ch==45||ch==91)
{
p=2;
}
else
if(ch==60||ch==44||ch==32||ch==61||ch==93)
{
p=0;
gotoxy(7,7);cout<<" ";
gotoxy(7,4);cout<<">";
}
}
if(p==2)
{
{
if(h==2){
gotoxy(7,4);cout<<" ";
}
gotoxy(7,7);cout<<" ";
gotoxy(41,7);cout<<">";
Page | 12
}
ch=getch();
if(ch==62||ch==46||ch==9||ch==45||ch==91) p=3;
else
if(ch==60||ch==44||ch==32||ch==61||ch==93)
{
if(h==1){
p=1;
gotoxy(41,7);cout<<" ";
gotoxy(7,7);cout<<">";
}
if(h==2){
p=0;gotoxy(41,7);cout<<" ";
}
}
}
if(p==3){
{
gotoxy(41,7);cout<<" ";
gotoxy(7,10);cout<<">";
}
ch=getch();
if(ch==62||ch==46||ch==9||ch==45||ch==91)p=4;
if(ch==60||ch==44||ch==32||ch==61||ch==93)
{
p=2;
gotoxy(7,10);cout<<" ";
gotoxy(41,7);cout<<">";
}
}
if(p==4)
{
{
gotoxy(7,10);cout<<" ";
gotoxy(41,10);cout<<">";
}
ch=getch();
if(ch==62||ch==46||ch==9||ch==45||ch==91)p=5;
else
if(ch==60||ch==44||ch==32||ch==61||ch==93)
{
p=3;
gotoxy(41,10);cout<<" ";
gotoxy(7,10);cout<<">";
}
}
if(p==5){
{
gotoxy(41,10);cout<<" ";
gotoxy(7,13);cout<<">";
}
ch=getch();
if(ch==62||ch==46||ch==9||ch==45||ch==91)p=6;
else
if(ch==60||ch==44||ch==32||ch==61||ch==93)
{
p=4;
Page | 13
gotoxy(7,13);cout<<" ";
gotoxy(41,10);cout<<">";
}
}
if(p==6)
{
{
gotoxy(7,13);cout<<" ";
gotoxy(32,18);cout<<">";
}
ch=getch();
if(ch==62||ch==46||ch==9||ch==45||ch==91)p=7;
else
if(ch==60||ch==44||ch==32||ch==61||ch==93)
{
p=5;
gotoxy(32,18);cout<<" ";
}
}
if(p==7)
{
{
gotoxy(32,18);cout<<" ";
gotoxy(49,18);cout<<">";
}
ch=getch();
if(ch==62||ch==46||ch==9||ch==45||ch==91)
{
p=0;gotoxy(49,18);cout<<" ";
}
else
if(ch==60||ch==44||ch==32||ch==61||ch==93)
{
p=6;
gotoxy(49,18);cout<<" ";
}
}
if(ch==27)screen();
if(ch==8)menu();
if(ch==115||ch==83||ch==107||ch==75)
{
if( p==0)
{
if(h==1)p=1;if(h==2)p=3;gotoxy(7,4);cout<<" ";
}
else if(p==1)
{
p=3;gotoxy(7,7);cout<<" ";
}
else
if(p==2)
{
p=4;gotoxy(41,7);cout<<" ";
}
else if(p==3||p==4)
{
p=5;
Page | 14
gotoxy(7,10);cout<<" ";
gotoxy(41,10);cout<<" ";
}
else
{
if(p==5)
p=6;
gotoxy(7,13);cout<<" ";
}
}
if(ch==68||ch==100||ch==108||ch==76)
{
if( p==1)
{
p=2;gotoxy(7,7);cout<<" ";
}
else if(p==3)
{
p=4;
gotoxy(41,10);cout<<" ";
}
else if(p==6)
{
p=7;
gotoxy(32,18);cout<<" ";
}
}
if(ch==97||ch==65||ch==106||ch==74)
{
if( p==2)
{
if(h==1)p=1;
gotoxy(41,7);cout<<" ";
}
else if(p==4)
{
p=3;
gotoxy(41,10);cout<<" ";
}
else if(p==7)
{
p=6;
gotoxy(49,18);cout<<" ";
}
}
if(ch==87||ch==119||ch==73||ch==105)
{
if(p==1||p==2)
{
p=0;gotoxy(41,7);cout<<" ";
gotoxy(7,7);cout<<" ";
}
if(p==3){
if(h==1)p=1;if(h==2)p=2;
gotoxy(7,10);cout<<" ";
}
if(p==4){
p=2;gotoxy(41,10);cout<<" ";
Page | 15
}
if(p==5)
{
p=3;
gotoxy(7,13);cout<<" ";
}
if(p==6||p==7)
{
p=5;
gotoxy(32,18);cout<<" ";gotoxy(49,18);cout<<" ";
}
}
if(ch==13)
{
if(p==0)
{
gotoxy(7,4);cout<<" ";
gotoxy(17,4);cout<<" ";
gotoxy(17,4);gets(name);
}
if(h==1)
if(p==1)
{
gotoxy(7,7);cout<<" ";
gotoxy(17,7);cout<<" ";
gotoxy(17,7);cin>>acc;
}
if(p==2)
{
gotoxy(41,7);cout<<" ";
gotoxy(53,7);cout<<" ";
gotoxy(53,7);cin>>type;
type=toupper(type);
}
if(p==3)
{
gotoxy(7,10);cout<<" ";
gotoxy(17,10);cout<<" ";
gotoxy(17,10);cout<<"+973";
gotoxy(21,10);cin>>tele;
}
if(p==4)
{
gotoxy(41,10);cout<<" ";
gotoxy(53,10);cout<<" ";
gotoxy(53,10);cin>>cash;
}
if(p==5)
{
gotoxy(7,13);cout<<" ";
gotoxy(17,13);cout<<" ";
gotoxy(17,13);gets(address);
}
if(p==6)
{
if(h==1)
{
Page | 16
clrscr();
addaccount(1);
}
if(h==2)
{
clrscr();addaccount(2);
}
}
if(p==7)
{
if(!(isalpha(name[1])&&isalpha(name[2])&&isalpha(name[3])))
{
clearoff(3,78,2,22,0);
gotoxy(20,11);
cout<<"Enter more than 3 alphabets for the name ";
gotoxy(31,12);
cout<<" Please try Again";
delay(6.5);
goto o;
}
if(!(acc>1000&&acc<10000))
{
clearoff(3,78,2,22,0);
gotoxy(26,11);
cout<<"Invalid Account Number Format";
gotoxy(31,12);
cout<<" Please try Again";
delay(6.5);
goto o;
}
if(!(type=='C'||type=='S'))
{
clearoff(3,78,2,22,0);
gotoxy(12,11);
cout<<" Invalid type ";
gotoxy(25,12);
cout<<" Please try Again";
delay(6.5);goto o;
}
if(!(tele>10000000&&tele<100000000))
{
clearoff(3,78,2,22,0);
gotoxy(30,11);
cout<<"Invalid Telephone Number";
gotoxy(33,12);
cout<<" Please try Again";
delay(6.5);
goto o;
}
if(!
(isalpha(address[1])&&isalpha(address[2])&&isalpha(address[3])))
{
clearoff(3,78,2,22,0);
gotoxy(20,11);
cout<<"Enter more than 3 alphabets for the address ";
gotoxy(32,12);
cout<<" Please try Again";
Page | 17
delay(6.5);
goto o;
}
Jscreen(0);
gotoxy(10,15);
cout<<"You thereby accknowledge to the BIGB's Terms and
Conditions";
if(h==1)
{
gotoxy(10,16);cout<<" Do you wish to Accept and Continue?";
}
if(h==2)
{
gotoxy(8,16);cout<<" Do you wish to Modify?";
}
column(2,1); int g=keys3(1);
if(g==0)
{
clrscr();loading(5);impress();
goto p;
}
if(g==1)
{
t=1;clearoff(4,74,4,22,0);goto o;
}
if(ch)goto x;
}
}
goto x;
p:;
}
int keys3(int l)
{
int g=0; char c; l: if(g==0)
{
{
gotoxy(46,20);cout<<"
";gotoxy(26,20);cout<<"$";if(l==1)logo(13,5,1,2.8);
}
c=getch();
if(c==62||c==46||c==9||c==45||c==91)g=1;
else
if(c==60||c==44||c==32||c==61||c==93)
{
g=1;
gotoxy(26,20);cout<<" ";
}
}
if(g==1)
{
Page | 18
{
gotoxy(26,20);cout<<" ";
gotoxy(46,20);cout<<"$";if(l==1)logo(13,5,1,2.8);
}
c=getch();
if(c==62||c==46||c==9||c==45||c==91)g=0;
else
if(c==60||c==44||c==32||c==61||c==93)
{
g=0;
gotoxy(46,20);cout<<" ";
}
}
if(c==68||c==100||c==108||c==76)
{
if( g==0)
{
g=1;gotoxy(46,20);cout<<" ";
}
}
if(c==97||c==65||c==106||c==74)
{
if( g==1)
{
g=0;gotoxy(26,20);cout<<" ";
}
}
if(c==13)return g;
if(c)goto l;goto l;
}
Page | 19
{
gotoxy(28,8);cout<<"ENTER YOUR ACCOUNT NUMBER:";
column(1,0);gotoxy(33,11);cin>>n;
gotoxy(28,8);cout<<" ";
beat(40,11,99,3.22222222222222221,6);
}
if(r==2)
n=a;
while(infile.read((char *)&J,sizeof(J))&&q==0)
{
if(J.raccno()==n)
{
if(r==1||r==3||r==4||r==5)
J.searchindividual();
q=1;
}
}
if((r==1||r==3||r==4||r==5)&& q==0)
{
clearoff(9,65,2,22,0); gotoxy(25,11);cout<<" Account Number does
not exist";
gotoxy(35,12);cout<<"Please try again";press(2);
if(r==1||r==5)searchdisplay();if(r==3)transaction();if(r==4)menu();
}
if(r==1)
{
press(3);impress();
}
infile.close();
if(r==2)return q;
if(r==3||r==4||r==5)return n;
}
void bank::searchindividual()
{
gotoxy(29,6);cout<<"Account details";
gotoxy(31,7);cout<<"Name :"<<name;
gotoxy(31,8);cout<<"Account Number:"<<acc;
gotoxy(31,9);cout<<"Total Amount :"<<cash;
gotoxy(31,10);cout<<"Account Type :"<<type;
gotoxy(31,11);cout<<"Phone Number :"<<tele;
gotoxy(31,12);cout<<"Address :"<<address;
}
//------------------------------------------------------------------------//**************FUNCTION TO DISPLAY DEFAULT TEXT ON SCREEN****************
//------------------------------------------------------------------------void column(int m,int h)
{
if(m==1)
{
gotoxy(32,10);cout<<"|----------------|";
gotoxy(32,11);cout<<"$ $";
gotoxy(32,12);cout<<"|----------------|";
}
Page | 20
if(m==2)
{
gotoxy(24,19);cout<<"|---------|";
gotoxy(24,20);
if(h==1)cout<<"$ Accept $";
else if(h==2)cout<<"$ ENTER $";
else if(h==3)cout<<"$ DELETE $";
else if(h==4)cout<<"$ LOGIN $";
else if(h==5)cout<<"$ Yes $";
gotoxy(24,21);cout<<"|---------|";
gotoxy(44,19);cout<<"|----------|";
gotoxy(44,20);
if(h==1)cout<<"$ Decline $";
else if(h==2||h==3)cout<<"$ CANCEL $";
else if(h==4) cout<<"$ CLEAR $";
else if(h==5) cout<<"$ NO $";
gotoxy(44,21);cout<<"|----------|";
}
if(m==3){
gotoxy(6,21);
cout<<" <> or {
}
or -+ or TAB and space bar or WASD or IJKL keys to move";
}
}
//------------------------------------------------------------------------//**************
FUNCTION TO AWAIL LOAN
****************
//------------------------------------------------------------------------void iloan()
{
Nscreen(2);
float n,interest,m,rate;
gotoxy(27,8);cout<<"ENTER THE PRINCIPAL AMOUNT:";
column(1,2);gotoxy(33,11);cin>>n;
gotoxy(23,8);cout<<" ";
gotoxy(25,8);cout<<"ENTER THE TOTAL NUMBER OF MONTHS:";
column(1,2);gotoxy(33,11);cin>>m;
gotoxy(23,8);cout<<" ";column(2,2);
gotoxy(26,8);cout<<"ENTER THE INTEREST RATE(%):";
column(1,2);gotoxy(33,11);cin>>rate;
gotoxy(23,8);cout<<" ";
int g=keys3(0);
if(g==0)
{
beat(40,11,99,3.22222222222222221,6);clearoff(20,60,4,22,0);
interest=n*(m/12)*(rate/100);
gotoxy(29,6);cout<<"LOAN DETAILS";
gotoxy(31,7);cout<<"PRINCIPAL AMT :"<<"BD "<<n;
gotoxy(31,8);cout<<"RATE :"<<rate<<"%";
gotoxy(31,9);cout<<"LOAN PERIOD :"<<m<<" months";
gotoxy(31,10);cout<<"TOTAL INTEREST :"<<"BD "<<interest;
gotoxy(31,11);cout<<"TOTAL AMOUNT :"<<"BD "<<n+interest;press(3);
impress();
}
else if(g==1)
Page | 21
{
searchdisplay();
}
}
//------------------------------------------------------------------------//**************
FUNCTION TO DISPLAY ACCOUNT REPORT
****************
//------------------------------------------------------------------------void ireport()
{
beat(40,11,99,3.22222222222222221,6);;
clrscr();
int t=1;
bank K;
ifstream rep;
rep.open("bank.dat",ios::binary|ios::in);
if(!rep)
{
gotoxy(17,12);cout<<"FILE DOES NOT EXIST.CONTACT JANS PVT LIMITED";
delay(8);searchdisplay();
}
cout<<" Reportn";
cout<<" Total Number of Customers- "<<endl;
cout<<"=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
=*=*=*=*=*=*";
cout<<"$ S/no. $ A/c no. $ NAME $ Type $ Balance $";
cout<<"=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
=*=*=*=*=*=*";
while(rep.read((char*)&K,sizeof(K)))
{
K.report(t);
t++;
}
gotoxy(53,2);cout<<t-1;
rep.close();
press(3);searchdisplay();
}
void bank ::report(int t)
{
int l=strlen(name);
cout<<"$ "<<t<<setw(9)<<"$ "<<acc<<setw(9)<<"$ "<<name<<setw(34-l)<<" $
"<<type<<setw(7)<<"$ "<<cash<<endl;
cout<<"********************************************************************
************";
}
//------------------------------------------------------------------------//************** FUNCTION TO MODIFY ACCOUNT CREDENTIALS
****************
//-------------------------------------------------------------------------
void imodify()
{
Page | 22
Nscreen(6);
bank J;
fstream infile;
infile.open("bank.dat",ios::binary|ios::in|ios::out);
int n;
n=iuserdisplay(0,5);column(2,5);gotoxy(30,18);cout<<"DO YOU WISH TO
MODIFY?";
int g=keys3(0);if(g==1)searchdisplay();else if(g==0)
while(infile.read((char*)&J,sizeof(J)))
{
if(J.raccno()==n)
{
J.addaccount(2);
int pos=(-1)*sizeof(bank);
infile.seekp(pos,ios::cur);
infile.write((char*)&J,sizeof(bank));
}
}
infile.close();
loading(6);impress();searchdisplay();
}
int a=0;
void login()
{
Nscreen(7);
char un[50],pass[50],ch;int i=0;
logo(14,5,1,4);column(2,4);
gotoxy(26,14);
cout<<"USERNAME:";
gotoxy(26,17);
cout<<"PASSWORD:";
gotoxy(35,13);cout<<"|----------------|";gotoxy(35,14);cout<<"$ $";
gotoxy(35,15);cout<<"|----------------|";gotoxy(35,16);cout<<"|---------------|";
gotoxy(35,17);cout<<"$ $";gotoxy(35,18);cout<<"|----------------|";
gotoxy(36,14); gets(un);
do{
gotoxy(36,17);ch=getch();
if(ch==8)
{
if(i==0){
gotoxy(36+i,17);
}
else
{
pass[i-1]='';
gotoxy(35+i,17);cout<<" ";
gotoxy(36+i,17);i--;
}
}
else if(ch!=13)
{
gotoxy(36+i,17);
pass[i]=ch; int q=rand()%7;
irandom(0,q);
i++;
Page | 23
}
else break;
}
while(ch!=13);
gotoxy(22,17);
pass[i]='';
if(strcmp("jansuser",pass)==0&&strcmp("JANS",un)==0)
a+=1;
else
a--;
int g=keys3(0);if(g==0)verify();else if(g==1)screen();
}
void verify()
{
if(a==1) menu();
else while(a<0&&a>-3)
{
delay(7);clearoff(3,77,4,22,0);
gotoxy(18,10);cout<<"Invalid Username OR Password. Please try
Againn";
gotoxy(18,11);cout<<" You have "<<a+3<<"attempt(s) left";
delay(7);
press(2);clrscr();login();
if(a==1)menu();
else if(a==-3)
{
delay(7);clearoff(3,77,4,22,0);
gotoxy(18,10);cout<<" SORRY YOU CAN NO LONGER CONTINUEn";
delay(7);clrscr();logo(14,5,1,4);
exit(0);
}
}
}
//------------------------------------------------------------------------//**************** FUNCTIONS TO DISPLAY THE MENU SCREEN *******************
//------------------------------------------------------------------------void menu()
{
Jscreen(1);
logo(13,5,1,4);
menu_();
}
void menu_()
{
char A[20]={
' ','$',' ','M','A','I','N',' ',' ',' ','M','E','N','U'
}
;
for(i=3,j=0;i<0,j<14;i++,j++)
{
gotoxy(5,i); delay(6);
cout<<A[j];
gotoxy(75,i);
cout<<A[j];
}
Page | 24
Page | 25
}
else
if(ch==60||ch==44||ch==32||ch==61||ch==93)
{
p=1;
gotoxy(12,18);cout<<" ";
}
}
if(p==3)
{
{
gotoxy(12,18);cout<<" ";
gotoxy(46,18);cout<<">";logo(13,5,1,2.8);
}
ch=getch();
if(ch==62||ch==46||ch==9||ch==45||ch==91)
{
p=0;
}
if(ch==60||ch==44||ch==32||ch==61||ch==93)
{
p=2;
gotoxy(46,18);cout<<" ";
}
}
if(ch==115||ch==83||ch==107||ch==75)
{
if( p==0)
{
p=2;
gotoxy(12,16);cout<<" ";
}
else if(p==1)
{
p=3;
gotoxy(46,16);cout<<" ";
}
}
if(ch==68||ch==100||ch==108||ch==76)
{
if( p==0)
{
p=1;
gotoxy(12,16);cout<<" ";
gotoxy(46,16);cout<<">";
}
else if(p==2)
{
p=3;
gotoxy(12,18);cout<<" ";
}
}
if(ch==97||ch==65||ch==106||ch==74)
{
if( p==1)
{
p=0;
Page | 26
gotoxy(46,16);cout<<" ";
}
else
if(p==3)
{
p=2;
gotoxy(46,18);cout<<" ";
}
}
if(ch==87||ch==119||ch==73||ch==105)
{
if( p==2)
{
p=0;
gotoxy(12,18);cout<<" ";
}
else if(p==3)
{
p=1;gotoxy(46,18);cout<<" ";
}
}
if(ch==13)
{
if(p==0)transaction();
if(p==1)iaddaccount();
if(p==2)searchdisplay();
if(p==3)ideleteaccount();
}
if(ch==27)
{
screen();
}
if(ch)
goto x;
}
//------------------------------------------------------------------------//*************** FUNCTION TO DISPLAY THE TRANSACTIONS MENU **************
//------------------------------------------------------------------------void transaction()
{
Jscreen(0);
char A[20]={
' ','$',' ','T','R','A','N','S','A','C','T','I','O','N','S'
}
;
for(i=3,j=0;i<0,j<15;i++,j++)
{
gotoxy(5,i); delay(6);
cout<<A[j];
gotoxy(75,i);
cout<<A[j];
}
gotoxy(13,16);
cout<<"$ DEPOSIT $ WITHDRAW";
gotoxy(13,18);
Page | 27
Page | 28
gotoxy(55,7);cout<<" ";
gotoxy(12,16);cout<<">";
}
else
if(ch==60||ch==44||ch==32||ch==61||ch==93)
{
p=1;gotoxy(12,18);cout<<" ";
}
}
if(ch==115||ch==83||ch==107||ch==75)
{
if( p==0)
{
p=2;
gotoxy(12,16);cout<<" ";
}
else
if(p==1)
{
p=2;
gotoxy(46,16);cout<<" ";
}
}
if(ch==68||ch==100||ch==108||ch==76)
{
if( p==0)
{
p=1;
gotoxy(12,16);cout<<" ";
}
else
if(p==2)
{
p=1; gotoxy(12,18); cout<<" ";
}
}
if(ch==97||ch==65||ch==106||ch==74)
if( p==1)
{
p=0;
gotoxy(55,16);cout<<" ";
}
if(ch==87||ch==119||ch==73||ch==108)
{
if( p==2)
{
p=0;
gotoxy(12,18);cout<<" ";
}
}
if(ch==13)
{
if(a==1)
{
if(p==0)idepositwithdraw(1);
if(p==1)idepositwithdraw(2);
if(p==2)iloan();
Page | 29
}
if(a==2)
{
if(p==0)iuserdisplay(0,1);
if(p==1)ireport();
if(p==2)imodify();
}
}
if(ch==27){
screen();
}
if(ch==8){
clearoff(3,78,2,22,0);menu_();
}
if(ch)goto x;
}
void searchdisplay()
{
Jscreen(0);
char A[20]={
' ','$',' ','S','E','A','R','C','H',' ','&','
','D','I','S','P','L','A','Y'
}
;
for(i=3,j=0;i<0,j<19;i++,j++)
{
gotoxy(5,i);delay(6);cout<<A[j];
gotoxy(75,i);cout<<A[j];
}
gotoxy(13,16);
cout<<"$ USER DISPLAY $ REPORT";
gotoxy(13,18);
cout<<"$ MODIFY ";
gotoxy(6,21);
column(3,0);gotoxy(13,22);cout<<" Press ESC to LOGOUT Press BACKSPACE
to go back";
keys2(2);
}
//-----------------------------------------------------------------------//************************* FUNCTION TO DELETE AN ACCOUNT ****************
//------------------------------------------------------------------------
void ideleteaccount()
{
int n[10];
Nscreen(1);
Page | 30
bank L;
ifstream infile;
ofstream outfile;
infile.open("bank.dat",ios::binary);
if(!infile)
{
cout<<"File does not exist";
}
n[10]=iuserdisplay(0,4);
gotoxy(29,15);cout<<"ARE YOU SURE YOU WANT TO";
gotoxy(24,16);cout<<"Permanently delete your account";column(2,3);int
g=keys3(0);
if(g==1)
{
menu();
}
else if(g==0)
{
outfile.open("temp.dat",ios::binary);
infile.seekg(0,ios::beg);
while(infile.read((char*)&L,sizeof(bank)))
{
if(L.raccno()!=n[10])
{
outfile.write((char*)&L,sizeof(bank));
}
}
}
infile.close();
outfile.close();
remove("bank.dat");
rename("temp.dat","bank.dat");
loading(4);impress();menu();
}
void idepositwithdraw(int d)
{
int n;long int money;
if(d==1)Nscreen(3);
if(d==2)Nscreen(4);
bank G;
fstream file;
file.open("bank.dat",ios::binary|ios::in|ios::out);
n=iuserdisplay(0,3);column(2,2);
gotoxy(29,15);cout<<"ENTER THE AMOUNT";
gotoxy(32,16);cout<<"|----------------|";
gotoxy(32,17);cout<<"$ $";
gotoxy(32,18);cout<<"|----------------|";
gotoxy(33,17);cin>>money;
int w=keys3(0);
if(w==1)
Page | 31
transaction();
if(w==0)
while(file.read((char*)&G,sizeof(bank)))
{
if(G.raccno()==n)
{
if(d==1) G.deposit(money);
if(d==2)
{
int bal=G.rcash()-money;
if(bal<500&&G.rtype()=='S'||(bal<1000)&&G.rtype()=='C')
{
clearoff(9,65,2,22,0); gotoxy(25,11);cout<<" You do
not have enough balance";
gotoxy(31,12);cout<<"Please try a lower amount";
press(2);idepositwithdraw(2);
}
else G.withdraw(money);
}
int pos=(-1)*sizeof(bank);
file.seekp(pos,ios::cur);
file.write((char*)&G,sizeof(bank));
}
}
file.close();
clrscr();
if(d==1)loading(2);if(d==2)loading(3);
impress();
transaction();
}
void bank::deposit(long int money)
{
cash+=money;
}
void bank::withdraw(long int money)
{
cash-=money;
}
Page | 32
";delay(6);cout<<"w";delay(6);cout<<"o";delay(6);cout<<"r";delay(6);cout<<"
l";delay(6);cout<<"d";delay(6);cout<<"
";delay(6);cout<<"c";delay(6);cout<<"o";delay(6);cout<<"m";delay(6);cout<<"
e";delay(6);cout<<"s";delay(6);cout<<"
";delay(6);cout<<"t";delay(6);cout<<"o";delay(6);cout<<"
";delay(6);cout<<"B";delay(6);cout<<"a";delay(6);cout<<"n";delay(6);cout<<"
k";delay(6);cout<<" ";gotoxy(22,18);
}
//-----------------------------------------------------------------------//**********************
THE DELAY FUNCTION
*****************
//------------------------------------------------------------------------
void delay(float q)
{
for(long int d=0;d<pow(10,q);d++);
}
Page | 33
if(d==78)gotoxy(d-x+3,f-y+3);
irandom(0,n);
delay(w);
x++;
}
x--;
while(y<=f)
{
gotoxy(x,y);
irandom(0,n);
if(d==80)
gotoxy(d-x,f-y);
if(d==79)gotoxy(d-x+2,f-y+2);
if(d==78)gotoxy(d-x+3,f-y+3);
irandom(0,q);
delay(w);
y++;
}
y--;
}
//-----------------------------------------------------------------------//**************** FUNCTION TO DISPLAY THE BORDER AND BEATS **************
//-----------------------------------------------------------------------void Jscreen(int h)
{
if(h==1)beat(40,11,99,3.22222222222222221,6);clrscr();
border2(1,1,80,24,5);border2(2,2,79,23,5);
}
Page | 34
Page | 35
void Nscreen(int l)
{
beat(40,11,99,3.22222222222222221,6);
clrscr();
for(i=0;i<3;i++)arrow(4);
border2(1,1,80,24,4.8);
if(l==1)
{
char A[20]={
'$',' ',' ',' ','D','E','L','E','T','E',' ','
','A','C','C','O','U','N','T'
}
;
for(i=2,j=0;i<21,j<19;i++,j++)
{
if(j==1||j==2||j==3||j==9||j==10||j==11)
continue;
gotoxy(7,i); delay(6);
cout<<A[j];
gotoxy(75,i);
cout<<A[j];
}
}
if(l==2)
{
char A[20]={
'$',' ',' ',' ','L',' ',' ',' ','O',' ',' ',' ','A',' ',' ','
','N'
}
;
Page | 36
for(i=2,j=0;i<16,j<17;i++,j++)
{
if(j==1||j==2||j==3||j==7||j==5||j==9||j==10||j==11)
continue;
gotoxy(7,i); delay(6);
cout<<A[j];
gotoxy(75,i);
cout<<A[j];
}
}
if(l==3)
{
char A[20]={
'$',' ',' ',' ','D',' ','E',' ','P',' ','O',' ','S',' ','I','
','T'
}
;
for(i=2,j=0;i<22,j<17;i++,j++)
{
if(j==1||j==3||j==5||j==11)
continue;
gotoxy(7,i); delay(6);
cout<<A[j];
gotoxy(75,i);
cout<<A[j];
}
}
if(l==4)
{
char A[20]={
'$',' ','W',' ','I',' ','T',' ','H',' ','D',' ','R',' ','A','
','W'
}
;
for(i=2,j=0;i<22,j<17;i++,j++)
{
if(j==1||j==3||j==5||j==11)
continue;
gotoxy(7,i); delay(6);
cout<<A[j];
gotoxy(75,i);
cout<<A[j];
}
}
if(l==5)
{
char A[20]={' ',' ',' ',' ','$',' ','U','S','E','R',' ','
','D','I','S','P','L','A','Y' };
for(i=2,j=0;i<22,j<19;i++,j++)
{
if(j==0||j==1||j==3||j==10||j==11)
continue;
gotoxy(7,i); delay(6);
cout<<A[j];
gotoxy(75,i);
cout<<A[j];
}
Page | 37
}
if(l==6)
{
char A[25]={
'$',' ',' ',' ','M',' ',' ',' ','O',' ',' ',' ','D',' ',' ','
','I',' ',' ',' ','Y'
}
;
for(i=2,j=0;i<21,j<21;i++,j++)
{
if(j==1||j==2||j==3||j==7||j==5||j==9||j==10||j==11||j==17||
j==18||j==19)
continue;
gotoxy(6,i); delay(6);
cout<<A[j];
gotoxy(75,i);
cout<<A[j];
}
}
if(l==7)
{
char A[20]={
'$',' ',' ','L',' ',' ','O',' ',' ','G',' ',' ','I',' ',' ','N'
}
;
for(i=3,j=0;i<0,j<16;i++,j++)
{
if(j==1||j==2||j==4||j==5||j==7||j==8||j==10||j==11||j==13||
j==14)continue;
gotoxy(7,i); delay(6);
cout<<A[j];
gotoxy(75,i);
cout<<A[j];
}
}
}
void arrow(int n)
{
int i,j,k;
for(i=0;i<n;i++)
{
for(j=0;j<i;j++)
{
cout<<" ";
}
for(k=0;k<i;k++)
{
cout<<"*";
}
cout<<endl;
}
for(i=0;i<n;i++)
{
for(j=0;j<n-i;j++)
{
cout<<" ";
}
Page | 38
for(k=0;k<n-i;k++)
{
cout<<"*";
}
cout<<endl;
}
}
//----------------------------------------------------------------------//************
FUNCTION TO DISPLAY THE LOADING SCREEN
************
//-----------------------------------------------------------------------
void loading(int h)
{
Jscreen(0);
gotoxy(17,18);
cout<<" ----------------------------------";
gotoxy(17,20);
cout<<" ----------------------------------";
gotoxy(17,19);
cout<<" || ||";
int t;for(j=23,t=0;j<57 ;j++,t++)
{
if(t==97)continue;
logo(12,5,1,3);
gotoxy(36,9);cout<<" ";
gotoxy(34,19);
if(h==1) cout<<"Loading "<<++t<<"%";
else if(h==2)cout<<"Depositing "<<++t<<"%";
else if(h==3)cout<<"Withdrawing"<<++t<<"%";
else if(h==4)cout<<"Deleting "<<++t<<"%";
else if(h==5)cout<<"Creating "<<++t<<"%";
else if(h==6)cout<<"Modifying "<<++t<<"%";t++;
gotoxy(j,19);cout<<"$";
}
delay(4);
}
void press(int l)
{
delay(7);
gotoxy(49,21);
if(l==1)cout<<"Press any key for Services";
if(l==2)cout<<"Press any key to retry";
if(l==3)cout<<"Press any key to go back";
getch();
}
//-----------------------------------------------------------------------//****************** FUNCTION TO DRAW A SPIRAL BORDER ********************
//------------------------------------------------------------------------
Page | 39
int a1=79,a2=79,a3=0,b1=80,b2=1,b3=1,c1=1,c2=24,c3=23,d1=24,d2=25,d3=0;
for(int n=0;n<noft;n++)
{
for(i=a;i<b;i++)
for(j=c;j<d;j++)
{
gotoxy(i,j);cout<<"$";
delay(q);
}
a++;b--;c++;d++;
for(i=a1;i<b1;i++)
for(j=c1;j<d1;j++)
{
gotoxy(i,j);cout<<"*";
delay(q);
}
a1--;b1--;c1++;d1--;
for(i=a2;i>b2;i--)
for(j=c2;j<d2;j++)
{
gotoxy(i,j);cout<<"*";
delay(q);
}
a2--;b2++;c2--;d2--;
for(i=a3;i<b3;i++)
for(j=c3;j>d3;j--)
{
gotoxy(i,j);cout<<"$";
delay(q);
}
a3++;b3++;c3--;d3++;
}
}
Page | 40
for(k=size;k>-1;k--)
{
for(i=0;i<100;i++)
for(j=0;j<100;j++)
{
if((i-x)*(i-x)+(j-y)*(j-y)==k)
{
gotoxy(i,j);cout<<" "; delay(delay1);
}
}
}
if(p%2==0)
{
delay(6.5);
}
}
}
Page | 41
Screenshots
Page | 42
Page | 43