Sunday 23 December 2012

C++ Project on Banking System



Banking System

#include<iostream.h>
#include<fstream.h>
#include<process.h>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#include<ctype.h>
#include<conio.h>
#include<dos.h>


//===========================================================
// THIS CLASS CONTAINS FUNCTIONS RELATED TO DRAW BOX ETC.
//===========================================================

class shape
{
public :
void line_hor(int, int, int, char);
void line_ver(int, int, int, char);
void box(int,int,int,int,char);
};

//===========================================================
// THIS CLASS CONTROL ALL THE FUNCTIONS IN THE MENU
//===========================================================

class control
{
public :
void main_menu(void);
void help(void);
private:
void edit_menu(void);
};

//===========================================================
// THIS CLASS CONTAINS FUNCTIONS RELATED TO INITIAL DEPOSIT
//===========================================================

class initial
{
public :
void add_to_file(int,char t_name[30],char t_address[60],float);
void display_list(void);
void delete_account(int);
void update_balance(int,float);
void modify(void);
int last_accno(void);
int found_account(int);
char *return_name(int);
char *return_address(int);
float give_balance(int);
int recordno(int);
void display(int);
private:
void modify_account(int,char t_name[30],char t_address[60]);
void box_for_list(void);

int accno;
char name[30],address[60];
float balance;
};

//===========================================================
// THIS CLASS CONTAINS FUNCTIONS RELATED TO TRANSACTIONS
//===========================================================

class account
{
public :
void new_account(void);
void close_account(void);
void display_account(void);
void transaction(void);
void clear(int,int);
private :
void add_to_file(int,int,int,int,char,char t_type[10],float,float,float);
void delete_account(int);
int no_of_days(int,int,int,int,int,int);
float calculate_interest(int,float);
void display(int);
void box_for_display(int);
int accno;
char type[10]; //Cheque or Cash
int dd,mm,yy; //Date
char tran ; // Deposit or withdrawl
float interest,amount,balance;
};

//===========================================================
// FUNCTION TO DRAW HORIZONTAL LINE
//===========================================================

void shape::line_hor(int column1,int column2,int row,char c)
{
for(column1;column1< =column2;column1++)
{
gotoxy(column1,row);
cout< }
}

//===========================================================
// FUNCTION TO DRAW VERTICAL LINE
//===========================================================

void shape::line_ver(int row1,int row2,int column,char c)
{
for(row1;row1 {
gotoxy(column,row1);
cout< }
}

//============================================================
// FUNCTION TO DRAW BOX LINE
//============================================================

void shape::box(int column1,int row1,int column2,int row2,char c)
{
char ch=218;
char c1,c2,c3,c4;
char l1=196,l2=179;
if(c==ch)
{
c1=218;
c2=191;
c3=192;
c4=217;
l1=196;
l2=179;
}
else
{
c1=c;
c2=c;
c3=c;
c4=c;
l1=c;
l2=c;
}
gotoxy(column1,row1);
cout< gotoxy(column2,row1);
cout< gotoxy(column1,row2);
cout< gotoxy(column2,row2);
cout< column1++;
column2–;
line_hor(column1,column2,row1,l1);
line_hor(column1,column2,row2,l1);
column1–;
column2++;
row1++;
row2–;
line_ver(row1,row2,column1,l2);
line_ver(row1,row2,column2,l2);
}

//============================================================
// FUNCTION TO DISPLAY MAIN MENU AND CALL OTHER FUNCTIONS
//============================================================

void control::main_menu(void)
{
char ch;
while (1)
{
clrscr();
shape s;
s.box(10,5,71,21,219);
s.box(9,4,72,22,218);
textcolor(LIGHTBLUE+BLINK);
textbackground(BLACK);
gotoxy(32,7);
cprintf(” B A N K I N G “);
gotoxy(35,9);
cprintf(” OPTIONS “);
textcolor(LIGHTBLUE);
textbackground(BLACK);
gotoxy(30,11);
cout<=EXIT”;
gotoxy(5,5);
cout< =EXIT”;
textbackground(BLACK);
gotoxy(3,3);
for(int i=1;i< =76;i++) cprintf(” “);
textbackground(BLACK);
textcolor(LIGHTBLUE+BLINK); textbackground(BLACK);
gotoxy(30,3);
cprintf(“MODIFY ACCOUNT SCREEN”);
textcolor(LIGHTBLUE); textbackground(BLACK);
int d1,m1,y1;
struct date d;
getdate(&d);
d1=d.da_day;
m1=d.da_mon;
y1=d.da_year;
gotoxy(62,5);
cout< char ch;
display(t_accno);
account a;
do
{
a.clear(5,13);
gotoxy(5,13);
cout< 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);
if(strlen(t_name)>0)
modified=1;
do
{
a.clear(15,16);
a.clear(5,23);
gotoxy(5,23);
cout< FOR NO CHANGE”;
valid=1;
gotoxy(15,16);
gets(t_address);
strupr(t_address);
if(t_address[0]==’0′)
return;
if(strlen(t_address)>55)
{
valid=0;
gotoxy(5,23);
cprintf(“7SHOULD NOT BLANK OR GREATER THAN 55″);
getch();
}
}while(!valid);
if(strlen(t_address)>0)
modified=1;
if(!modified)
return;
a.clear(5,23);
do
{
a.clear(5,18);
gotoxy(5,18);
cout< =EXIT”;
textbackground(BLACK);
gotoxy(3,3);
for(i=1;i< =76;i++)
cprintf(” “);
textbackground(BLACK);
textcolor(LIGHTBLUE+BLINK); textbackground(BLACK);
gotoxy(32,3);
cprintf(“OPEN NEW ACCOUNT”);
textcolor(LIGHTBLUE);
textbackground(BLACK);
int d1,m1,y1;
struct date d;
getdate(&d);
d1=d.da_day;
m1=d.da_mon;
y1=d.da_year;
int t_accno;
t_accno=ini.last_accno();
t_accno++;
if(t_accno==1)
{
ini.add_to_file(t_accno,”abc”,”xyz”,1.1);
ini.delete_account(t_accno);
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[60];
float t_bal=0.0, t_balance=0.0;
gotoxy(5,6);
cout< gotoxy(5,8);
cout<=EXIT”;
gotoxy(5,5);
cout< =EXIT”;
gotoxy(5,5);
cout< =EXIT”;
textbackground(BLACK);
gotoxy(3,3);
for(int i=1;i< =76;i++) cprintf(” “);
textbackground(BLACK);
textcolor(LIGHTBLUE+BLINK); textbackground(BLACK);
gotoxy(29,3);
cprintf(“TRANSACTION IN ACCOUNT”);
textcolor(LIGHTBLUE); 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<=EXIT”;
gotoxy(5,5);
cout< =EXIT”;
textbackground(BLACK);
gotoxy(3,3);
for(int i=1;i< =76;i++) cprintf(” “);
textbackground(BLACK);
textcolor(GREEN+BLINK); textbackground(BLACK);
gotoxy(30,3);
cprintf(“CLOSE ACCOUNT SCREEN”);
textcolor(LIGHTBLUE); textbackground(BLACK);
int d1,m1,y1;
struct date d;
getdate(&d);
d1=d.da_day;
m1=d.da_mon;
y1=d.da_year;
gotoxy(62,5);
cout< getch();
}

//===============================================================
//THIS IS MAIN FUNCTION CALLING HELP AND MAIN MENU
//FUNCTIONS
//===============================================================

void main(void)
{
control c;
c.help();
c.main_menu();
}

Please do +1, Like, Share, Send, this page to support us.

0 comments:

Post a Comment

 

SCROLL TO TOP