My photo
Bangalore, Karnataka, India
Extending one hand to help someone has more value rather than joining two hands for prayer

Archives

project of banking

Tuesday, September 1, 2009

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

static int transactioncode;
static int accountnumber;
int sm,tempo1,tempo;
struct inter
{
int accno;
float interest;
long balance;
};

struct joint
{
 public:
 int accno;
 char namej[100];
 char fatherj[100];
 char dobj[100];
 char addressj[100];
 char phonj[100];
 public:
void jointin()
{
 cout<<"\n give personal detail of joint partner";
 cout<<"\n name of partner is:";     gets(namej);
  cout<<"\n father name:";gets(fatherj);
 cout<<"\n date of birth:";gets(dobj);
 cout<<"\n address is:";   gets(addressj);
 cout<<"\n phone no. :";   gets(phonj);

}
void jointout()
{
 cout<<"\n  personal detail of joint partner";
 cout<<"\n name of partner is:";     puts(namej);
 cout<<"\n father name:";puts(fatherj);
 cout<<"\n date of birth:";puts(dobj);
 cout<<"\n address is:";   puts(addressj);
 cout<<"\n phone no. :";   puts(phonj);
}
};

struct node1
{
 joint info;
 node1 *link;
};

struct mem
{
 int  ac_no;
 char name[100];
 int dayb;
 int monthb;
 int yearb;
 char father[100];
 char address[100];
 char ph_no[100];
 joint d;
 int j;
long balance;
 int day;
 int month;
 int year;
 char status[100];
 char type[100];

 fstream oo;

 public:
    void get();
    void show();
};

  void mem::get()
{
  cout<<"\nEnter acc No : ";
  ac_no=accountnumber;
  accountnumber++;
  cout<<ac_no;
  cout<<"\nEnter Name : ";
  gets(name);

while(1)
 {
 cout<<"\n Enter dob : "<<"format is day\nmonth\nyear\n ";
 cout<<"\n holder must be of 10 year old or more in age:";
 cin>>dayb;
 cin>>monthb;
 cin>>yearb;

 if(yearb<1900 || yearb>1995)
 {
 cout<<"\n invalid date";
 continue;
 }
 if(monthb<1 || monthb>12)
 {
 cout<<"\n invalid date";
 continue;
 }
 if(dayb>31)
 {
 cout<<"\n invalid date:";
  continue;

 }

 if(monthb==2)
 {
  if(dayb>28)
  {
  cout<<"invalid date";
   continue;
  }
  }
  if(monthb==4||monthb==6||monthb==9||monthb==11)
  {
  if(dayb==31)
  {
  cout<<"\n invalid date";
  continue;
  }
  }

  break;

 }
 cout<<"\nEnter fathername : ";gets(father);
 cout<<"\nenter adedress:";
gets(address);
cout<<"\nphone no";
gets(ph_no);
//if(strlen(ph_no)=10 &&ph_no[1]==0 ||ph_no[1]==9)
//{
//cout<<" correct np:";
//break;
//}
//else
//cout<<"enter correct no";

//}

 while(1)
 {
 cout<<"\nEnter balance: ";
 cin>>balance;
 if(balance>1000)
 {
  cout<<"\nsufficient credit limit:";
  break;
 }
  cout<<"\nlow";
 }

 while(1)
 {
 cout<<"\n Enter doc : "<<"format is day\nmonth\nyear\n ";

 cin>>day;
 cin>>month;
 cin>>year;

 if(year<1990 || year>2005)
 {
 cout<<"\n invalid date";
 continue;
 }
 if(month<1 || month>12)
 {
 cout<<"\n invalid date";
 continue;
 }
 if(day>31)
 {
 cout<<"\n invalid date:";
  continue;

 }

 if(month==2)
 {
  if(day>28)
  {
  cout<<"invalid date";
   continue;
  }
  }
  if(month==4||month==6||month==9||month==11)
  {
  if(day==31)
  {
  cout<<"\n invalid date";
  continue;
  }
  }

  break;

 }
  while(1)
  {
 cout<<"\nEnter status : ";
 cout<<"\n for ACTIVE put   [ a ]   fOR INACTIVE put  [  i  ] ";
 gets(status);
 if(strcmp(status,"a")==0)
  {
  cout<<"\naccount is running:";
   break;
  }
  }
 cout<<"enter type:";
 cout<<"\n for single put [  s ]  and for joint put  [   j  ]";
 gets(type);
 if(strcmp(type,"j")==0)
{
 cout<<"\n how many joint members:";
 cin>>j;

 oo.open("d:\\turboc3\\joint.bin",ios::app|ios::out|ios::binary);

 for(int i=0;i<j;i++)         //problem 1
 {
 d.accno=ac_no;
 d.jointin();
 oo.write((char*)&d,sizeof(d));
 }

 oo.close();
 }else
 j=0;

}

void mem::show()
{
cout<<"\n**************************************";
cout<<"\nacc no is:"; cout<<ac_no;
cout<<"\nname is"; puts(name);
cout<<"\ndob:"; cout<<dayb<<"/"<<monthb<<"/"<<yearb;
cout<<"\nfather"; puts(father);
cout<<"\naddress:"; puts(address);
cout<<"\nph no is:"; puts(ph_no);
cout<<"\nbalance is"; cout<<balance;
cout<<"\ndoc:"; cout<<day<<"/"<<month<<"/"<<year;
cout<<"\nstatus"; puts(status);
cout<<"\ntype:"; puts(type);

 if(strcmp(type,"j")==0)
 {
  oo.open("d:\\turboc3\\joint.bin",ios::binary|ios::in);
  while(1)
  {
  oo.read((char*)&d,sizeof(d));
  if(oo.eof())
  break;

  if(d.accno==ac_no)
  d.jointout();
  }
 oo.close();
}
cout<<"\n*********************************";
}


struct node
{
 mem info;
 node* link;
};

   int trc;

class records
{
mem s;
joint d;
int x,y,z,l,l1;
node *start;
node1 *start1;
public:
records()
{

 start=NULL;
 start1=NULL;
}

void add()
{ fstream f;
 f.open("d:\\turboc3\\prob1.bin",ios::out|ios::app|ios::binary);
 s.get();
 f.write((char*)&s,sizeof(s));
 f.close();
}
void showall()
{
fstream f,f1;
f.open("d:\\turboc3\\prob1.bin",ios::in|ios::binary);
f1.open("d:\\turboc3\\joint.bin",ios::in|ios::binary);
if(f.fail())
{
cout<<"File not found"<<endl;
f.close();
f1.close();
return;
}
if(f1.fail())
{
cout<<"File not found"<<endl;
f1.close();
//f.close();  //////////////////////////iuluil
//return;
}
while(1)
{
f.read((char*)&s,sizeof(s));
f1.read((char*)&d,sizeof(d));
if(f.eof())
break;
s.show();
}
f1.close();
f.close();
}
void addtolist()
{
   fstream f;
   start=NULL;
 f.open("d:\\turboc3\\prob1.bin",ios::in|ios::binary);

 while(!f.eof())
 {
    f.read((char*)&s,sizeof(s));
    if(f.eof())
    break;
    node *p1=new node;
    node *m1;
        p1->info.ac_no=s.ac_no;
        strcpy(p1->info.name,s.name);
        p1->info.dayb=s.dayb;
        p1->info.monthb=s.monthb;
        p1->info.yearb=s.yearb;
        strcpy(p1->info.father,s.father);
        strcpy(p1->info.address,s.address);
        strcpy(p1->info.ph_no,s.ph_no);
        p1->info.balance=s.balance;
        p1->info.day=s.day;
        p1->info.month=s.month;
        p1->info.year=s.year;

        strcpy(p1->info.status,s.status);
        strcpy(p1->info.type,s.type);
    p1->link=NULL;
    m1=start;
    if(m1==NULL)
    start=p1;
    else
    if(m1->link==NULL)
    m1->link=p1;
    else
    {
     while(m1->link!=NULL)
     m1=m1->link;
     m1->link=p1;
    }

  }
  f.close();
}
 void addtofile()
{ fstream f;
 node *k;
 k=start;
 f.open("d:\\turboc3\\prob1.bin",ios::out|ios::binary);
 while(k!=NULL)
 {
     s.ac_no=k->info.ac_no;
     strcpy(s.name,k->info.name);
     s.dayb=k->info.dayb;
     s.monthb=k->info.monthb;
     s.yearb=k->info.yearb;
     strcpy(s.father,k->info.father);
     strcpy(s.address,k->info.address);
     strcpy(s.ph_no,k->info.ph_no);
     s.balance=k->info.balance;
     strcpy(s.status,k->info.status);
     s.day=k->info.day;
     s.month=k->info.month;
     s.year=k->info.year;
     strcpy(s.type,k->info.type);

      f.write((char*)&s,sizeof(s));
    k=k->link;
 }
 f.close();
}

void modifyrec()
{
 char tempn[20];
  int tempday,tempmonth,tempyear;
  char tempf[20];
  char tempadd[20];
  char tempph[20];
 int x,y;

 node *p2;
 addtolist();

 p2=start;
 cout<<endl<<"Enter the account no to be modified = ";
 int accc;
 cin>>accc;
 char temp1[100];
 while(p2!=NULL)
  {
 if(accc==p2->info.ac_no)// && p2->info.status=="a")
 {
 cout<<"Enter New Name = ";
 cin>>tempn;
 strcpy(p2->info.name,tempn);
 while(1)
 {
 cout<<"\n Enter new dob : "<<"format is day\nmonth\nyear\n ";
 cout<<"\n holder must be of 10 year old or more in age:";
 cin>>tempday;
 cin>>tempmonth;
 cin>>tempyear;


 if(tempyear<1900 || tempyear>1995)
 {
 cout<<"\n invalid date";
 continue;
 }
 if(tempmonth<1 || tempmonth>12)
 {
 cout<<"\n invalid date";
 continue;
 }
 if(tempday>31)
 {
 cout<<"\n invalid date:";
  continue;

 }

 if(tempmonth==2)
 {
  if(tempday>28)
  {
  cout<<"invalid date";
   continue;
  }
  }
  if(tempmonth==4||tempmonth==6||tempmonth==9||tempmonth==11)
  {
  if(tempday==31)
  {
  cout<<"\n invalid date";
  continue;
  }
  }

  break;

 }
p2->info.dayb=tempday;
p2->info.monthb=tempmonth;
p2->info.monthb=tempyear;

 cout<<"Enter New father Name = ";
 cin>>tempf;
 strcpy(p2->info.father,tempf);

 cout<<"Enter New address= ";
 cin>>tempadd;
 strcpy(p2->info.address,tempadd);
 cout<<"Enter New phone no = ";
 cin>>tempph;
 strcpy(p2->info.ph_no,tempph);
  }
 p2=p2->link;
 }                        //else kithe lana hai
 addtofile();
}


void change()
{
 char temps[20];
  int x,y;

 node *p2;
 addtolist();

 p2=start;
 cout<<endl<<"Enter the account no whosew status is to be changed = ";
 int accc;
 cin>>accc;
 char temp1[100];
 while(p2!=NULL)
  {
 if(accc==p2->info.ac_no )
 {
 cout<<"enter i to deactivate and a to activate ";


 cin>>temps;
 strcpy(p2->info.status,temps);
  }
 p2=p2->link;
 }
 addtofile();
}

//cout<<"*****************************************";

void addjointtolist()
{ fstream f1;
 start1=NULL;

 f1.open("d:\\turboc3\\joint.bin",ios::in|ios::binary);

 while(1)
 {
    f1.read((char*)&d,sizeof(d));
    if(f1.eof())
    break;
    node1 *p2=new node1;
    node1 *m1;

    p2->info.accno=d.accno;
    strcpy(p2->info.namej,d.namej);
        strcpy(p2->info.dobj,d.dobj);
        strcpy(p2->info.fatherj,d.fatherj);
        strcpy(p2->info.addressj,d.addressj);
        strcpy(p2->info.phonj,d.phonj);
    p2->link=NULL;
    m1=start1;
    if(m1==NULL)
    start1=p2;
    else
    if(m1->link==NULL)
    m1->link=p2;
    else
    {
    while(m1->link!=NULL)
    m1=m1->link;
     m1->link=p2;
    }
 }
 f1.close();
}

void addjointtofile()
{
fstream f1;
 node1 *k;
 k=start1;

 f1.open("d:\\turboc3\\joint.bin",ios::out|ios::binary);
 while(k!=NULL)
 {
     d.accno=k->info.accno;
     strcpy(d.namej,k->info.namej);
     strcpy(d.dobj,k->info.dobj);
     strcpy(d.fatherj,k->info.fatherj);
     strcpy(d.addressj,k->info.addressj);
     strcpy(d.phonj,k->info.phonj);
     f1.write((char*)&d,sizeof(d));
     k=k->link;
 }
 f1.close();
}


void modifyjointrec()
{
//char temp1[20];
  char tempnj[20];
  char tempdj[20];
  char tempfj[20];
  char tempaddj[20];
  char tempphj[20];
 int x,y;
 node1 *p3;
 addjointtolist();

 p3=start1;
 cout<<endl<<"Enter the account no whose joint mem is to be modified = ";
 int accc;
 cin>>accc;
 char temp1[100];
 cout<<"\n enter name of joint mem whose record is to b modified";
 gets(temp1);
 while(p3!=NULL)
  {
 if(strcmp(temp1,p3->info.namej)==0 && accc==p3->info.accno )
 {  cout<<"Enter New Name = ";


 cin>>tempnj;
 strcpy(p3->info.namej,tempnj);

 cout<<"Enter New dob= ";
 cin>>tempdj;
 strcpy(p3->info.dobj,tempdj);

 cout<<"Enter New father Name = ";
 cin>>tempfj;
 strcpy(p3->info.fatherj,tempfj);

 cout<<"Enter New address= ";
 cin>>tempaddj;
 strcpy(p3->info.addressj,tempaddj);
 cout<<"Enter New phone no = ";
 cin>>tempphj;

 strcpy(p3->info.phonj,tempphj);
 }
  p3=p3->link;

 }
 addjointtofile();
}
//33333333333333333333333333333333333333

void searcha()
{
 int temp;
 int x,y,count=0;
 cout<<"enter account no.";
 cin>>temp;
 node *p2;
 node *save,*ptr;
 node1 *ptr1;
 addtolist();
 addjointtolist();
  int i=0;
  ptr=new node;
  ptr1=new node1;
  ptr=start;
  ptr1=start1;

  while(ptr!=NULL)
  {
//  cout<<"acno="<<ptr->info.ac_no<<"  "<<temp<<endl;
   if( ptr->info.ac_no==temp)
   {
   cout<<"acc found"<<endl;
   i=1;

   cout<<"\n account found";
   cout<<"\n name is  :";

   cout<<ptr->info.name;
   cout<<"\n dob is   :";

//   cout<<ptr->info.dob;
   cout<<"\n father name is";
   cout<<ptr->info.father;
   cout<<"\n address is   :";
   cout<<ptr->info.address;
   cout<<"\n phone no is  :";
   cout<<ptr->info.ph_no;

     cout<<"\n balance is  :";
   cout<<ptr->info.balance;

   ptr1=start1;
   cout<<"\n type="<<ptr->info.type<<endl;
   if(strcmp(ptr->info.type,"j")==0)
   {
   while(ptr1!=NULL)
   {
   if(ptr1->info.accno==temp)
   {
   cout<<"\n joint mem";
   cout<<"\n name of joint mem is:";
   cout<<ptr1->info.namej;
   cout<<"\n dob of joint mem is";
   cout<<ptr1->info.dobj;

   cout<<"\n address of joint mem is";   //prob1;
   cout<<ptr1->info.addressj;
   cout<<"\n phone of joint mem is";
   cout<<ptr1->info.phonj;
   }
   ptr1=ptr1->link;
   }
   }

    }
  ptr=ptr->link;
  count++;
  }
  if(i==0)
  {
  cout<<"No member corressponding to this Account no. exists";
  getch();
  return;
  }
  }
};

struct trans
{
 mem s;
char type[10];
 int acc;
 int tracode;
int dayt;
int montht;
int yeart;
 int amount;
 char mode[100];
long bal;
 char cheqno[20];     char ddno[20];
 char docheq[20];     char dodd[20];
 char bank[20];
 char branch[20];

 public:
 void gettra();
 void gettra2();
 void showtra();
 fstream x;
};

void trans::gettra()
{

 cout<<"Enter acc No : "; cin>>acc;
//if(acc==s.ac_no)                      //
//{                                       //
 cout<<"Enter tracode: ";
 tracode=   transactioncode;
 transactioncode++;
 cout<<tracode;
/* if(acc==s.ac_no);
 {
 cout<<"\n balance is  ";
 bal=s.balance;
 cout<<bal;
 }*/
// cout<<"Enter dot : ";gets(dot);
/*   struct date d;

getdate(&d);

yeart=d.da_year;
dayt=d.da_day;
montht=d.da_mon;
cout<<"current date is "<<dayt<<"/"<<montht<<"/"<<yeart<<endl;
  */
 while(1)
 {
 cout<<"\n Enter doc : "<<"format is day/month/year ";

 cin>>dayt;
 cin>>montht;
 cin>>yeart;
 if(yeart<1990||yeart>2006)
 {
 cout<<"\n invalid date";
  continue;
 }
 if(montht<1||montht>12)
 {
 cout<<"\n invalid date";
   continue;
 }
 if(dayt>31)
 {
 cout<<"\n invalid date:";
  continue;

 }

 if(montht==2)
 {
  if(dayt>28)
  {
  cout<<"invalid date";
   continue;
  }
  }
  if(montht==4||montht==6||montht==9||montht==11)
  {
  if(dayt==31)
  {
  cout<<"\n invalid date";
   continue;
  }

  }

  break;


}
 cout<<"Enter amount: ";cin>>amount;
 cout<<"enter mode:";
 gets(mode);
 if(strcmp(mode,"cheq")==0)
 {

  cout<<"transfer by cheq:";
  cout<<"\n enter cheque no";gets(cheqno);
  cout<<"\n enter date of cheque"; gets(docheq);
  cout<<"\n enter bank name";   gets(bank);
  cout<<"\n enter branch"; gets(branch);
 }

/* if(strcmp(mode,"dd")==0)
{
cout<<"\n transfer by demand draft:";
cout<<"\n enter demand draft no:";gets(ddno);
cout<<"\n enter demand draft date";gets(dodd);
 }*/

  if(strcmp(mode,"translip")==0)
 {
  cout<<"transfer by transfer slip:";

 }
       if(strcmp(mode,"atm")==0)
 {
  cout<<"transfer by atm:";
 }


}
//else                               //
//{                                 //
//cout<<"invalid account no";
  //
//}  //
//}//


void trans::gettra2()
{

 cout<<"Enter acc No : "; cin>>acc;
 cout<<"Enter tracode: ";
 tracode=   transactioncode;
 transactioncode++;
 cout<<tracode;
/* struct date d;

getdate(&d);

yeart=d.da_year;
dayt=d.da_day;
montht=d.da_mon;
cout<<"current date is "<<dayt<<"/"<<montht<<"/"<<yeart<<endl;
*/
 while(1)
 {
 cout<<"\n Enter dot : "<<"format is day/month/year ";///////////new func
 cin>>dayt;
 cin>>montht;
 cin>>yeart;
 if(yeart<1990||yeart>2006)
 {
 cout<<"\n invalid date";
  continue;
 }
 if(montht<1||montht>12)
 {
 cout<<"\n invalid date";
   continue;
 }
 if(dayt>31)
 {
 cout<<"\n invalid date:";
  continue;

 }

 if(montht==2)
 {
  if(dayt>28)
  {
  cout<<"invalid date";
   continue;
  }
  }
  if(montht==4||montht==6||montht==9||montht==11)
  {
  if(dayt==31)
  {
  cout<<"\n invalid date";
   continue;
  }

  }

  break;


}
 cout<<"Enter amount: ";cin>>amount;
 cout<<"enter mode:";
 cout<<"/n for cheque-------------cheq";
 cout<<"\n for demand draft-------dd";
 cout<<"\n for cash---------------cash";
 gets(mode);
 if(strcmp(mode,"cheq")==0)
 {
  cout<<"transfer by cheq:";
  cout<<"\n enter cheque no";gets(cheqno);
  cout<<"\n enter date of cheque"; gets(docheq);
  cout<<"\n enter bank name";   gets(bank);
  cout<<"\n enter branch"; gets(branch);
 }

 if(strcmp(mode,"dd")==0)
{
cout<<"\n transfer by demand draft:";
cout<<"\n enter demand draft no:";gets(ddno);
cout<<"\n enter demand draft date";gets(dodd);
 }

 if(strcmp(mode,"cash")==0)
 {
 cout<<"deposite by cash:";
 }
 }

void trans::showtra()
{
cout<<"\nType"<<type;
cout<<"\nacc no is:";cout<<acc;
if(acc==s.ac_no)
{
cout<<"\ntracode is"; cout<<tracode;
cout<<"dot";
cout<<dayt<<"/"<<montht<<"/"<<yeart;

cout<<"\namount"; cout<<amount;
cout<<"\nmode:"; puts(mode);
cout<<"\nbalance"<<bal;

if(strcmp(mode,"cheq")==0)
 {
  cout<<"\ntransfer by cheq:";
  cout<<"\n  cheque no";puts(cheqno);
  cout<<"\n  date of cheque"; puts(docheq);
  cout<<"\n  bank name";   puts(bank);
  cout<<"\n  branch"; puts(branch);


 }

  if(strcmp(mode,"dd")==0)
 {
  cout<<"transfer by demand draft:";
  cout<<"\n demand draft no:";puts(ddno);
 cout<<"\n demand draft date";puts(dodd);
}
}
}
struct node2
{
trans info;
node2 *link;
};

class transaction
{
trans t;
mem s;
long bal;

int rec;
//node2 *start2;
node *start;
node2 *start2;
public:
transaction()
{
 start=NULL;
 start2=NULL;

}

/*void withdraw()
{
 fstream f2,f;
 f2.open("d:\\turboc3\\tra.bin",ios::out|ios::app|ios::binary);
// t.gettra();

 strcpy(t.type,"Withdraw");

 int x,y;
 node *p2;
 start=NULL;
 f.open("d:\\turboc3\\prob1.bin",ios::in|ios::binary);
 while(!f.eof())
 {
    f.read((char*)&s,sizeof(s));
    if(f.eof())
    break;
    node *p1=new node;
    node *m1;
    p1->info.ac_no=s.ac_no;
     //    strcpy(p1->info.name,s.name);
//    strcpy(p1->info.dob,s.dob);
    strcpy(p1->info.father,s.father);
    strcpy(p1->info.address,s.address);
    strcpy(p1->info.ph_no,s.ph_no);
        p1->info.j=s.j;
    p1->info.balance=s.balance;
    strcpy(p1->info.type,s.type);
    strcpy(p1->info.status,s.status);
   //    strcpy(p1->info.doc,s.doc);
    p1->link=NULL;
    m1=start;
    if(m1==NULL)
    start=p1;
    else
    if(m1->link==NULL)
    m1->link=p1;
    else
    {
     while(m1->link!=NULL)
       {
     m1=m1->link;
     }
     }
     m1->link=p1;
  }
     f.close();
 p2=start;
 cout<<endl<<"Enter the account in which tra  to be done = ";
 cin>>x;
 if(x==p2->info.ac_no)
 {
 cout<<"enter ammount:";
 int a,b,newbal;
 cin>>a;
 b=p2->info.balance;
 newbal=b-a;
 cout<<"new bal";
 }


x=t.acc-9999;
 for(int i=1;i<=x-1;i++)
 {
 p2=p2->link;
 }
 t.bal=p2->info.balance;
 int temp;
 temp=t.bal;

 while(1)
 {
 t.bal=temp-t.amount;
 if(t.bal>500)
 {
 cout<<"\n\n sufficient credit limit";
 break;
  }
  cout<<"Enter Amount ";
  int a;
  cin>>a;
  t.amount=a;
 }

 cout<<"\n New balance is = ";
 cout<<t.bal;
 p2->info.balance=t.bal;
 cout<<"list bal="<< p2->info.balance<<endl;

 node *k;
 k=start;
 f.open("d:\\turboc3\\prob1.bin",ios::out|ios::binary);
 while(k!=NULL)
 {
     s.ac_no=k->info.ac_no;
     strcpy(s.name,k->info.name);
//     strcpy(s.dob,k->info.dob);
     strcpy(s.father,k->info.father);
     strcpy(s.address,k->info.address);
     strcpy(s.ph_no,k->info.ph_no);
     s.balance=k->info.balance;
       //     strcpy(s.doc,k->info.doc);
     strcpy(s.status,k->info.status);
     strcpy(s.type,k->info.type);

     f.write((char*)&s,sizeof(s));
     k=k->link;
 }
 f.close();
  f2.write((char*)&t,sizeof(t));
  f2.close();

}
*/

void withdraw1()
{
 fstream f2,f;
 f2.open("d:\\turboc3\\tra.bin",ios::out|ios::app|ios::binary);
 t.gettra();
 strcpy(t.type,"Withdraw");
 int x,y;
 node *p2;
 start=NULL;
 f.open("d:\\turboc3\\prob1.bin",ios::in|ios::binary);
 while(!f.eof())
 {
    f.read((char*)&s,sizeof(s));
    if(f.eof())
    break;
    node *p1=new node;
    node *m1;
    p1->info.ac_no=s.ac_no;
    strcpy(p1->info.name,s.name);
//    strcpy(p1->info.dob,s.dob);
    strcpy(p1->info.father,s.father);
    strcpy(p1->info.address,s.address);
    strcpy(p1->info.ph_no,s.ph_no);
        p1->info.j=s.j;
    p1->info.balance=s.balance;
    strcpy(p1->info.type,s.type);
    strcpy(p1->info.status,s.status);
   //    strcpy(p1->info.doc,s.doc);
    p1->link=NULL;
    m1=start;
    if(m1==NULL)
    start=p1;
    else
    if(m1->link==NULL)
    m1->link=p1;
    else
    {
     while(m1->link!=NULL)
       {
     m1=m1->link;
     }
     }
     m1->link=p1;
  }
     f.close();
 p2=start;
// cout<<endl<<"Enter the account in which tra  to be done = ";
// cin>>x;
x=t.acc-9999;
cout<<"###################";
cout<<x;
 for(int i=1;i<=x-1;i++)
 {
 p2=p2->link;
 }
 t.bal=p2->info.balance;
 int temp;
 temp=t.bal;

 while(1)
 {
 t.bal=temp-t.amount;
 if(t.bal>500)
 {
 cout<<"\n\n sufficient credit limit";
 break;
  }
  cout<<"Enter Amount ";
  int a;
  cin>>a;
  t.amount=a;
 }

 cout<<"\n New balance is = ";
 cout<<t.bal;
 p2->info.balance=t.bal;
 cout<<"list bal="<< p2->info.balance<<endl;
 node *k;
 k=start;
 f.open("d:\\turboc3\\prob1.bin",ios::out|ios::binary);
 while(k!=NULL)
 {
     s.ac_no=k->info.ac_no;
     strcpy(s.name,k->info.name);
//     strcpy(s.dob,k->info.dob);
     strcpy(s.father,k->info.father);
     strcpy(s.address,k->info.address);
     strcpy(s.ph_no,k->info.ph_no);
     s.balance=k->info.balance;
       //     strcpy(s.doc,k->info.doc);
     strcpy(s.status,k->info.status);
     strcpy(s.type,k->info.type);
     f.write((char*)&s,sizeof(s));
     k=k->link;
 }
 f.close();
  f2.write((char*)&t,sizeof(t));
  f2.close();
}

void deposite()
{
 fstream f2,f;
 f2.open("d:\\turboc3\\tra.bin",ios::out|ios::app|ios::binary);
 t.gettra2();
  strcpy(t.type,"DEPOSITE");
 int tempbal;
 int x,y;
 node *p2;
 start=NULL;
 f.open("d:\\turboc3\\prob1.bin",ios::in|ios::binary);
 while(!f.eof())
 {
    f.read((char*)&s,sizeof(s));
    if(f.eof())
    break;
    node *p1=new node;
    node *m1;
    p1->info.ac_no=s.ac_no;
    strcpy(p1->info.name,s.name);
//    strcpy(p1->info.dob,s.dob);
    strcpy(p1->info.father,s.father);
    strcpy(p1->info.address,s.address);
    strcpy(p1->info.ph_no,s.ph_no);
    p1->info.j=s.j;
    p1->info.balance=s.balance;
    strcpy(p1->info.type,s.type);
    strcpy(p1->info.status,s.status);
     //    strcpy(p1->info.doc,s.doc);
    p1->link=NULL;
    m1=start;
    if(m1==NULL)
    start=p1;
    else
    if(m1->link==NULL)
    m1->link=p1;
    else
    {
     while(m1->link!=NULL)
     m1=m1->link;
     m1->link=p1;
    }

  }
  f.close();
   p2=start;
 x=t.acc-9999;
 cout<<"#############";
 cout<<x;

 for(int i=1;i<=x-1;i++)
 {
p2=p2->link;
 }
 t.bal=p2->info.balance;
 t.bal=t.bal+t.amount;
 cout<<" New balance is = ";
 cout<<t.bal;
 p2->info.balance=t.bal;
 node *k;
 k=start;
 f.open("d:\\turboc3\\prob1.bin",ios::out|ios::binary);
 while(k!=NULL)
 {
     s.ac_no=k->info.ac_no;
     strcpy(s.name,k->info.name);
//     strcpy(s.dob,k->info.dob);
     strcpy(s.father,k->info.father);
     strcpy(s.address,k->info.address);
     strcpy(s.ph_no,k->info.ph_no);
     s.balance=k->info.balance;
     strcpy(s.type,k->info.type);
//         strcpy(s.doc,k->info.doc);
     strcpy(s.status,k->info.status);

     f.write((char*)&s,sizeof(s));
     k=k->link;
 }
 f.close();
  f2.write((char*)&t,sizeof(t));
  f2.close();
}




void showtraall1()
{
clrscr();
fstream f2;
f2.open("d:\\turboc3\\tra.bin",ios::in|ios::binary);
if(f2.fail())
{
cout<<"File not found"<<endl;
f2.close();
return;
}
int i=47,j=2;
while(1)
{

f2.read((char*)&t,sizeof(t));
if(f2.eof())
break;
if(i==47)
{
gotoxy(1,1);
cout<<"ACC NO";
gotoxy(10,1);
cout<<" DOT";
gotoxy(20,1);
cout<<"TRA CODE";
gotoxy(28,1);
cout<<" AMOUNT";
gotoxy(36,1);
cout<<"BALANCE";
gotoxy(44,1);
cout<<"MODE";
gotoxy(52,1);
cout<<"TYPE";
i=2;
//int j=2;
}

//if(t.montht>2&&t.montht<9&&t.yeart==2005)
if((t.montht>9&&t.montht<=12&&t.yeart==2004)||(t.montht>=1&&t.montht<=3&&t.yeart==2005))

{
if(t.montht==10&&(t.dayt>=1&&t.dayt<=10))
{

sm=t.bal;
tempo=sm;
}
else
{
if(sm>t.bal)
{
sm=t.bal;
tempo=sm;
//cout<<tempo;
}
}


if(t.montht==10&&(t.dayt>=1&&t.dayt<=10))
{
sm=t.bal;
tempo1=sm;
}
else
{
if(sm>t.bal)
{
sm=t.bal;
tempo1=sm;
}
}
}
else
{
sm=t.bal;
}
}
/*gotoxy(1,j);
cout<<t.acc;
gotoxy(10,j);
cout<<t.dayt<<"/"<<t.montht<<"/"<<t.yeart;

//cout<<t.dot;
gotoxy(20,j);
cout<<t.tracode;
gotoxy(28,j);
cout<<t.amount;
gotoxy(36,j);
cout<<t.bal;
gotoxy(44,j);
cout<<t.mode;
gotoxy(52,j);
cout<<t.type;
j++;
}
}   */
f2.close();
}
//--------------------------------------------------------------------------

void interest1()
{
fstream fi;
inter ss;
long min10,min30,min;
long march=0,apr=0,may=0,june=0,july=0,aug=0;
struct date d;
getdate(&d);
int year;
year=d.da_year;
fstream f2,f;
f.open("d:\\turboc3\\prob1.bin",ios::in|ios::binary);
if(f.fail())
{
cout<<"File not found"<<endl;
f.close();
return;
}
while(1)
{
f.read((char*)&s,sizeof(s));
if(f.eof())
break;
for(int i=3;i<=8;i++)
{ //3

cout<<"fgesvfergverg===="<<i<<endl<<endl;

f2.open("d:\\turboc3\\tra.bin",ios::in|ios::binary);
if(f2.fail())
{
cout<<"File not found"<<endl;
f2.close();
return;
}
while(1)
{
f2.read((char*)&t,sizeof(t));
if(f2.eof())
break;
if(s.ac_no==t.acc && t.montht==i && t.yeart==year-1)
{    //5
min10=min30=t.bal;
break;
}
}
f2.close();
f2.open("d:\\turboc3\\tra.bin",ios::in|ios::binary);
if(f2.fail())
{
cout<<"File not found"<<endl;
f2.close();
return;
}

while(1)
{ //3
f2.read((char*)&t,sizeof(t));
if(f2.eof())
break;
cout<<"month====="<<t.montht<<endl<<endl;
if( s.ac_no==t.acc && i==t.montht && year-1==t.yeart)
{
//if(t.dayt>=1 && t.dayt<=10)

//if(i==t.montht)
//{
if(t.dayt==10)
{
if(t.bal<min10)
{
min10=t.bal;
}}//4
if(t.dayt>=11 && t.dayt<=31)
{
if(t.bal<min30)
{
min30=t.bal;
}
 }

cout<<endl<<s.ac_no<<endl<<t.dayt<<"/"<<t.montht<<"/"<<t.yeart<<endl;
cout<<t.bal<<endl<<t.type<<"    min10="<<min10<<"  min30="<<min30<<endl;
}
getch();
}
    //2
if(min10<=min30)
{
min=min10;
cout<<"min bal of "<<s.ac_no<<" in "<<i<<" month="<<min10<<endl;
}
else
{
min=min30;
cout<<"min bal of "<<s.ac_no<<" in "<<i<<" month="<<min30<<endl;
}
if(i==3)
march=min;
else if(i==4)
apr=min;
else if(i==5)
may=min;
else if(i==6)
june=min;
else if(i==7)
july=min;
else if(i==8)
aug=min;
f2.close();
}
float interest=(march+apr+may+june+july+aug)*0.04*0.5;
cout<<"\n\ninterest======"<<interest<<endl<<endl;
fi.open("d:\\turboc3\\interest.bin",ios::app|ios::binary);
if(fi.fail())
{
cout<<"File not found"<<endl;
fi.close();
return;
}
ss.accno=s.ac_no;
ss.interest=interest;
ss.balance=s.balance+ss.interest;
fi.write((char*)&ss,sizeof(ss));
fi.close();
}
       //0
f.close();
f2.close();



 int tempbal;
 int x,y;
 node *p2;
 start=NULL;
 f.open("d:\\turboc3\\prob1.bin",ios::in|ios::binary);
 while(!f.eof())
 {
    f.read((char*)&s,sizeof(s));
    if(f.eof())
    break;
    node *p1=new node;
    node *m1;
    p1->info.ac_no=s.ac_no;
    strcpy(p1->info.name,s.name);
//    strcpy(p1->info.dob,s.dob);
    strcpy(p1->info.father,s.father);
    strcpy(p1->info.address,s.address);
    strcpy(p1->info.ph_no,s.ph_no);
    p1->info.j=s.j;
    p1->info.balance=s.balance;
    strcpy(p1->info.type,s.type);
    strcpy(p1->info.status,s.status);
     //    strcpy(p1->info.doc,s.doc);
    p1->link=NULL;
    m1=start;
    if(m1==NULL)
    start=p1;
    else
    if(m1->link==NULL)
    m1->link=p1;
    else
    {
     while(m1->link!=NULL)
     m1=m1->link;
     m1->link=p1;
    }

  }
  f.close();

fi.open("d:\\turboc3\\interest.bin",ios::in|ios::binary);
if(fi.fail())
{
cout<<"File not found"<<endl;
fi.close();
return;
}
while(1)
{
fi.read((char*)&ss,sizeof(ss));

if(fi.eof())
{ fi.close();
break;
 }
 p2=start;
 x=ss.accno-9999;
 cout<<"#############=";
 cout<<x;

 for(int i=1;i<=x-1;i++)
 {
p2=p2->link;
 }
 p2->info.balance=ss.balance;
 cout<<" New balance is = "<<p2->info.balance<<endl;
 node *k;
 k=start;
 f.open("d:\\turboc3\\prob1.bin",ios::out|ios::binary);
 while(k!=NULL)
 {
     s.ac_no=k->info.ac_no;
     strcpy(s.name,k->info.name);
//     strcpy(s.dob,k->info.dob);
     strcpy(s.father,k->info.father);
     strcpy(s.address,k->info.address);
     strcpy(s.ph_no,k->info.ph_no);
     s.balance=k->info.balance;
     strcpy(s.type,k->info.type);
//         strcpy(s.doc,k->info.doc);
     strcpy(s.status,k->info.status);

     f.write((char*)&s,sizeof(s));
     k=k->link;
 }
 f.close();
}

fi.close();
}


void interest2()
{
inter ss;
fstream fi;
long min10,min30,min;
long sep=0, oct=0,nov=0,dec=0,jan=0,feb=0;
long interest;
struct date d;

getdate(&d);
int year=d.da_year;
fstream f2,f;


f.close();
f.open("d:\\turboc3\\prob1.bin",ios::in|ios::binary);
if(f.fail())
{
cout<<"File not found"<<endl;
f.close();
return;
}
while(1)
{
f.read((char*)&s,sizeof(s));
if(f.eof())
break;
for(int i=9;i<=12;i++)
{
cout<<"fgesvfergverg===="<<i<<endl<<endl;
f2.open("d:\\turboc3\\tra.bin",ios::in|ios::binary);
if(f2.fail())
{
cout<<"File not found"<<endl;
f2.close();
return;
}
while(1)
{
f2.read((char*)&t,sizeof(t));
if(f2.eof())
break;
if(s.ac_no==t.acc && t.montht==i && t.yeart==year-1)
{
min10=min30=t.bal;
break;
}
}
f2.close();
f2.open("d:\\turboc3\\tra.bin",ios::in|ios::binary);
if(f2.fail())
{
cout<<"File not found"<<endl;
f2.close();
return;
}

while(1)
{
f2.read((char*)&t,sizeof(t));
if(f2.eof())
break;
cout<<"month====="<<t.montht<<endl<<endl;
if( s.ac_no==t.acc && i==t.montht && year-1==t.yeart)
{

//if(t.dayt>=1 && t.dayt<=10)

//if(i==t.montht)
//{
if(t.dayt==10)
{
if(t.bal<min10)
{
min10=t.bal;
}}
if(t.dayt>=11 && t.dayt<=31)
{
if(t.bal<min30)
{
min30=t.bal;
}
}

cout<<endl<<s.ac_no<<endl<<t.dayt<<"/"<<t.montht<<"/"<<t.yeart<<endl;
cout<<t.bal<<endl<<t.type<<"    min10="<<min10<<"  min30="<<min30<<endl;
}
getch();
}
//-----------------------

 if(min10<=min30)
{
min=min10;
cout<<"min bal of "<<s.ac_no<<" in "<<i<<" month="<<min10<<endl;
}
else
{
min=min30;
cout<<"min bal of "<<s.ac_no<<" in "<<i<<" month="<<min30<<endl;
}
if(i==9)
sep=min;
else if(i==10)
oct=min;
else if(i==11)
nov=min;
else if(i==12)
dec=min;
f2.close();
}
interest=(sep+oct+nov+dec)*0.04*0.5;
cout<<"\n\ninterest======"<<interest<<endl<<endl;
fi.open("d:\\turboc3\\interest1.bin",ios::app|ios::binary);
if(fi.fail())
{
cout<<"File not found"<<endl;
fi.close();
return;
}
ss.accno=s.ac_no;
ss.interest=interest;
ss.balance=s.balance+ss.interest;
fi.write((char*)&ss,sizeof(ss));
fi.close();
}



//-----------------------
/*if(min10<=min30)
cout<<"min bal of "<<s.ac_no<<" in "<<i<<" month="<<min10<<endl;
else
cout<<"min bal of "<<s.ac_no<<" in "<<i<<" month="<<min30<<endl;
f2.close();
}
} */
f.close();
f2.close();
//--------------------
f.open("d:\\turboc3\\prob1.bin",ios::in|ios::binary);
if(f.fail())
{
cout<<"File not found"<<endl;
f.close();
return;
}
while(1)
{
f.read((char*)&s,sizeof(s));
if(f.eof())
break;

for(int i=1;i<=2;i++)
{
cout<<"fgesvfergverg===="<<i<<endl<<endl;

f2.open("d:\\turboc3\\tra.bin",ios::in|ios::binary);
if(f2.fail())
{
cout<<"File not found"<<endl;
f2.close();
return;
}
while(1)
{//2
f2.read((char*)&t,sizeof(t));
if(f2.eof())
break;
if(s.ac_no==t.acc && t.montht==i && t.yeart==year)
{
min10=min30=t.bal;
break;
}
}
f2.close();
f2.open("d:\\turboc3\\tra.bin",ios::in|ios::binary);
if(f2.fail())
{
cout<<"File not found"<<endl;
f2.close();
return;
}   //1

while(1)
{
f2.read((char*)&t,sizeof(t));
if(f2.eof())
break;
cout<<"month====="<<t.montht<<endl<<endl;
if( s.ac_no==t.acc && i==t.montht && year==t.yeart)
{

if(t.dayt==10)
{
if(t.bal<min10)
{
min10=t.bal;
}}

if(t.dayt>=11 && t.dayt<=31)
{
if(t.bal<min30)
{
min30=t.bal;
}
 }     //3

cout<<endl<<s.ac_no<<endl<<t.dayt<<"/"<<t.montht<<"/"<<t.yeart<<endl;
cout<<t.bal<<endl<<t.type<<"    min10="<<min10<<"  min30="<<min30<<endl;
}
getch();
}
//------------------
  if(min10<=min30)
{
min=min10;
cout<<"min bal of "<<s.ac_no<<" in "<<i<<" month="<<min10<<endl;
}
else
{
min=min30;
cout<<"min bal of "<<s.ac_no<<" in "<<i<<" month="<<min30<<endl;
}
if(i==1)
jan=min;
else if(i==2)
feb=min;

f2.close();
}
float interest=(jan+feb)*0.04*0.5;
cout<<"\n\ninterest======"<<interest<<endl<<endl;
fi.open("d:\\turboc3\\interest1.bin",ios::app|ios::binary);
if(fi.fail())
{
cout<<"File not found"<<endl;
fi.close();
return;
}
ss.accno=s.ac_no;
ss.interest=interest;
ss.balance=s.balance+ss.interest;
fi.write((char*)&ss,sizeof(ss));
fi.close();
}


//---------
/*if(min10<=min30)
cout<<"min bal of "<<s.ac_no<<" in "<<i<<" month="<<min10<<endl;
else
cout<<"min bal of "<<s.ac_no<<" in "<<i<<" month="<<min30<<endl;
f2.close();
 }
} */

f.close();
f2.close();
//-------------------------------------------------------------------
 int tempbal;
 int x,y;
 node *p2;
 start=NULL;
 f.open("d:\\turboc3\\prob1.bin",ios::in|ios::binary);
 while(!f.eof())
 {
    f.read((char*)&s,sizeof(s));
    if(f.eof())
    break;
    node *p1=new node;
    node *m1;
    p1->info.ac_no=s.ac_no;
    strcpy(p1->info.name,s.name);
//    strcpy(p1->info.dob,s.dob);
    strcpy(p1->info.father,s.father);
    strcpy(p1->info.address,s.address);
    strcpy(p1->info.ph_no,s.ph_no);
    p1->info.j=s.j;
    p1->info.balance=s.balance;
    strcpy(p1->info.type,s.type);
    strcpy(p1->info.status,s.status);
     //    strcpy(p1->info.doc,s.doc);
    p1->link=NULL;
    m1=start;
    if(m1==NULL)
    start=p1;
    else
    if(m1->link==NULL)
    m1->link=p1;
    else
    {
     while(m1->link!=NULL)
     m1=m1->link;
     m1->link=p1;
    }

  }
  f.close();

fi.open("d:\\turboc3\\interest.bin",ios::in|ios::binary);
if(fi.fail())
{
cout<<"File not found"<<endl;
fi.close();
return;
}
while(1)
{
fi.read((char*)&ss,sizeof(ss));

if(fi.eof())
{ fi.close();
break;
 }
 p2=start;
 x=ss.accno-9999;
 cout<<"#############=";
 cout<<x;

 for(int i=1;i<=x-1;i++)
 {
p2=p2->link;
 }
 p2->info.balance=ss.balance;
 cout<<" New balance is = "<<p2->info.balance<<endl;
 node *k;
 k=start;
 f.open("d:\\turboc3\\prob1.bin",ios::out|ios::binary);
 while(k!=NULL)
 {
     s.ac_no=k->info.ac_no;
     strcpy(s.name,k->info.name);
//     strcpy(s.dob,k->info.dob);
     strcpy(s.father,k->info.father);
     strcpy(s.address,k->info.address);
     strcpy(s.ph_no,k->info.ph_no);
     s.balance=k->info.balance;
     strcpy(s.type,k->info.type);
//         strcpy(s.doc,k->info.doc);
     strcpy(s.status,k->info.status);

     f.write((char*)&s,sizeof(s));
     k=k->link;
 }
 f.close();
}

fi.close();
}

//--------------------------------------------------------------------------
void showtraall()
{
clrscr();
fstream f2;
f2.open("d:\\turboc3\\tra.bin",ios::in|ios::binary);
if(f2.fail())
{
cout<<"File not found"<<endl;
f2.close();
return;
}
int i=47,j=2;

while(1)
{

f2.read((char*)&t,sizeof(t));
if(f2.eof())
break;
if(i==47)
{
gotoxy(1,1);
cout<<"ACC NO";
gotoxy(10,1);
cout<<" DOT";
gotoxy(20,1);
cout<<"TRA CODE";
gotoxy(28,1);
cout<<" AMOUNT";
gotoxy(36,1);
cout<<"BALANCE";
gotoxy(44,1);
cout<<"MODE";
gotoxy(52,1);
cout<<"TYPE";
i=2;
//int j=2;
}

gotoxy(1,j);
cout<<t.acc;
gotoxy(10,j);
cout<<t.dayt<<"/"<<t.montht<<"/"<<t.yeart;

//cout<<t.dot;
gotoxy(20,j);
cout<<t.tracode;
gotoxy(28,j);
cout<<t.amount;
gotoxy(36,j);
cout<<t.bal;
gotoxy(44,j);
cout<<t.mode;
gotoxy(52,j);
cout<<t.type;
j++;
}


f2.close();
}

void addtratolist()
{
    fstream f2;

start2=NULL;
 f2.open("d:\\turboc3\\tra.bin",ios::in|ios::binary);
 while(!f2.eof())
 {
    f2.read((char*)&t,sizeof(t));
    if(f2.eof())
    break;
    node2 *p2=new node2;
    node2 *m2;
    p2->info.acc=t.acc;
        p2->info.tracode=t.tracode;
    p2->info.dayt,t.dayt;
            p2->info.montht,t.montht;
        p2->info.yeart,t.yeart;
    p2->info.amount=t.amount;
    strcpy(p2->info.mode,t.mode);
    p2->link=NULL;
    m2=start2;
    if(m2==NULL)
    start2=p2;
    else
    if(m2->link==NULL)
    m2->link=p2;
    else
    {
     while(m2->link!=NULL)
     m2=m2->link;
     m2->link=p2;
    }

  }
  f2.close();
}


 void addtratofile()
{ fstream f2;
 node *k;
 k=start2;
 f2.open("d:\\turboc3\\tra.bin",ios::out|ios::binary);
 while(k!=NULL)
 {
     t.acc=k->info.acc;
         t.tracode=k->info.tracode;

     t.dayt=k->info.dayt;
      t.montht=k->info.montht;
      t.yeart=k->info.yeart;


     t.amount=k->info.amount;
       strcpy(t.mode,k->info.mode);
     f.write((char*)&t,sizeof(t));
    k=k->link;
 }
 f2.close();
}

void report2()
{

 int temp;
 int x,y,count=0;
 cout<<"enter account no.";
 cin>>temp;
 node2 *p2;
 node2 *save,*ptr;
 node2 *ptr1;
 addtratolist();
  int i=0;
  ptr1=new node2;
  ptr1=start2;
  while(ptr1!=NULL)
  {
   if( ptr1->info.acc==temp)
   {
   cout<<"acc found"<<endl;
   i=1;
   cout<<"\n  is  :";
   cout<<ptr1->info.acc;
   cout<<"\ntracode is   :";
   cout<<ptr1->info.tracode;
       cout<<"\n date of transfer is  :";
   cout<<ptr1->info.dayt<<"/"<<ptr1->info.montht<<"/"<<ptr1->info.yeart;

       cout<<"\n mode is   :";
   cout<<ptr1->info.mode;
       cout<<"\n amount is   :";
   cout<<ptr1->info.amount;

 }
  ptr1=ptr1->link;
  count++;
  }
  if(i==0)
  {
  cout<<"No member corressponding to this Account no. exists";
  getch();
  return;
  }
  }



  void report3()
{

 int temp;
 int x,y,count=0;
 cout<<"enter transaction code no.";
 cin>>temp;
 node2 *p2;
 node2 *save,*ptr;
 node2 *ptr1;
 addtratolist();
  int i=0;
  ptr1=new node2;
  ptr1=start2;
  while(ptr1!=NULL)
  {
   if( ptr1->info.tracode==temp)
   {
   cout<<"transaction code found"<<endl;
   i=1;
   cout<<"\n account in which tra is done is  :";
   cout<<ptr1->info.acc;
   cout<<"\ntracode is   :";
   cout<<ptr1->info.tracode;
       cout<<"\n date of transfer is  :";
//   cout<<ptr1->info.dot;
     cout<<ptr1->info.dayt<<"/"<<ptr1->info.montht<<"/"<<ptr1->info.yeart;
       cout<<"\n mode is   :";
   cout<<ptr1->info.mode;
       cout<<"\n amount is   :";
   cout<<ptr1->info.amount;

 }
  ptr1=ptr1->link;
  count++;
  }
  if(i==0)
  {
  cout<<"No member corressponding to this tracode no. exists";
  getch();
  return;
  }
  }

  void report4()
{

 char temp[22];
 int x,y,count=0;
 cout<<"enter mode no.";
 cin>>temp;
 node2 *p2;
 node2 *save,*ptr;
 node2 *ptr1;
 addtratolist();
  int i=0;
  ptr1=new node2;
  ptr1=start2;
  while(ptr1!=NULL)
  {
   if( strcmp(ptr1->info.mode,temp)==0)
   {
   cout<<"mode of transaction found found"<<endl;
   i=1;
   cout<<"\n account in which tra is done is  :";
   cout<<ptr1->info.acc;
   cout<<"\ntracode is   :";
   cout<<ptr1->info.tracode;
       cout<<"\n date of transfer is  :";
  // cout<<ptr1->info.dot;
       cout<<ptr1->info.dayt<<"/"<<ptr1->info.montht<<"/"<<ptr1->info.yeart;
       cout<<"\n mode is   :";
   cout<<ptr1->info.mode;
       cout<<"\n amount is   :";
   cout<<ptr1->info.amount;

 }
  ptr1=ptr1->link;
  count++;
  }
  if(i==0)
  {
  cout<<"No member corressponding to this tracode no. exists";
  getch();
  return;
  }
  }

  void report5()
{

 int tempd;
 int tempm;
 int tempy;
 int x,y,count=0;
 cout<<"enter dot no.";
 cin>>tempd ;
 cin>>tempm;
 cin>>tempy;

 node2 *p2;
 node2 *save,*ptr;
 node2 *ptr1;
 addtratolist();
  int i=0;
  ptr1=new node2;
  ptr1=start2;
  while(ptr1!=NULL)
  {
   if( ptr1->info.dayt==tempd&&ptr1->info.montht==tempm&&ptr1->info.yeart==tempy)
   {
   cout<<"dot  found"<<endl;
   i=1;
   cout<<"\n account in which tra is done is  :";
   cout<<ptr1->info.acc;
   cout<<"\ntracode is   :";
   cout<<ptr1->info.tracode;
       cout<<"\n date of transfer is  :";
   cout<<ptr1->info.dayt<<"/"<<ptr1->info.montht<<"/"<<ptr1->info.yeart;

       cout<<"\n mode is   :";
   cout<<ptr1->info.mode;
       cout<<"\n amount is   :";
   cout<<ptr1->info.amount;

 }
  ptr1=ptr1->link;
  count++;
  }
  if(i==0)
  {
  cout<<"No member corressponding to this tracode no. exists";
  getch();
  return;
  }
  }

};

int isNum(char m[])
{
 for(int i=0;m[i]!='\0';i++)
 if(m[i]<48||m[i]>57)
 return 0;

 return 1;
}

int menu()
{
char choice[10];
int chs;
clrscr();
cout<<"*************************"<<endl;
cout<<"1.ACCOUNT MANAGEMENT"<<endl;
cout<<"2.TRANSACTION"<<endl;
cout<<"3.BALANCE"<<endl;
cout<<"4.REPORT"<<endl;
cout<<"5.EXIT"<<endl;
cout<<"6.DELETE FILE"<<endl;
cout<<"Enter your choice : ";
gets(choice);
if(!isNum(choice))
{
cout<<"Enter a valid choice...Press any key to get Menu again"<<endl;
getch();
menu();
}
chs=atoi(choice);
return chs;
}

int menu2()
{
char choic[10];
int ch2;
clrscr();
cout<<"*************************"<<endl;
cout<<"1.NEW ACCOUNT "<<endl;
cout<<"2.CHANGE DETAILS OF ACCOUNT"<<endl;
cout<<"3.CHANGE DETAIL OF JOINT MEM"<<endl;
cout<<"4.SHOW DETAIL OF ALL THE ACCOUNTS"<<endl;
cout<<"5.SEARCH ACCOUNT"<<endl;
cout<<"6.Exit"<<endl;
cout<<"7.change status"<<endl;
cout<<"*************************"<<endl;
cout<<"Enter your choice : ";
gets(choic);
if(!isNum(choic))
{
cout<<"Enter a valid choice...Press any key to get Menu again"<<endl;

getch();
}
ch2=atoi(choic);
return ch2;
}

int menu3()
{

char choic[10];
int ch2;
clrscr();
cout<<"*************************"<<endl;
cout<<"1.WITHDRAWL"<<endl;
cout<<"2.DEPOSITE"<<endl;
cout<<"3.CALCULATE INTEREST"<<endl;
cout<<"4.SHOW BAL"<<endl;
cout<<"5.BACK"<<endl;
cout<<"*************************"<<endl;
cout<<"Enter your choice : ";
gets(choic);
if(!isNum(choic))
{
cout<<"Enter a valid choice...Press any key to get Menu again"<<endl;

getch();
}
ch2=atoi(choic);
return ch2;
}


int menu4()
{
char choic4[10];
int ch4;
clrscr();
cout<<"*************************"<<endl;
cout<<"1.REPORT OF ALL THE TRANSACTION DONE"<<endl;
cout<<"2.REPORT ON TRANSCATION ON PARTICULAR ACCOUNT"<<endl;
cout<<"3.REPORT OF PARTICULAR TRANSACTION CODE"<<endl;
cout<<"4.REPORT ON mode:"<<endl;
cout<<"6.REPOT OF ALL ACCOUNT HOLDERS"<<endl;
cout<<"5.Exit"<<endl;
cout<<"7.report on dot"<<endl;

cout<<"*************************"<<endl;
cout<<"Enter your choice : ";
gets(choic4);
if(!isNum(choic4))
{
cout<<"Enter a valid choice...Press any key to get Menu again"<<endl;


getch();
}
ch4=atoi(choic4);
return ch4;
}

void report9()
{
 fstream fi;
 inter ss;
fi.open("d:\\turboc3\\interest.bin",ios::in|ios::binary);
if(fi.fail())
{
cout<<"File not found"<<endl;
fi.close();
return;
}
cout<<"\nACCOUNT NO\tINTEREST\tBALANCE\n";
while(1)
{
fi.read((char*)&ss,sizeof(ss));
if(fi.eof())
break;
cout<<endl<<ss.accno<<"\t\t"<<ss.interest<<"\t\t"<<ss.balance<<endl;
}
fi.close();
}
void main()
{
trans ss;
mem dd;
transaction z;

fstream h;
h.open("d:\\turboc3\\tra.bin",ios::binary|ios::app|ios::in);
h.seekg(0,ios::end);
transactioncode=h.tellg()/sizeof(ss);
transactioncode=transactioncode+1000;
h.close();


fstream hh;
hh.open("d:\\turboc3\\prob1.bin",ios::binary|ios::app|ios::in);
hh.seekg(0,ios::end);
accountnumber=hh.tellg()/sizeof(dd);
cout<<"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&=="<<accountnumber<<endl;
getch();
accountnumber=accountnumber+10000;

hh.close();

records r;
clrscr();
start:


 int chx;
 while(1)
 {
 chx=menu();
 switch(chx)
 {
 case 1:
 cout<<"\n\t ACCOUNT MANAGEMENT \n";
 int chm2;
 while(1)
 {

 chm2=menu2();
 switch(chm2)
 {
  case 1:
  cout<<"\n ADD NEW ACCOUNT :";
  r.add();
  break;
  case 2:
  cout<<"CHANGE PERSONAL DETAIL OF MEMBER:";
  r.modifyrec();
  break;
  case 3:
  cout<<"\n CHANGE PERSONAL DETAIL OF JOINT MEMBER:";
   r.modifyjointrec();
  break;
  case 4:
  cout<<"\n show personal  info of all account:";
  r.showall();

  break;
  case 5:
     cout<<"\n search particular i nfo account";
   r.searcha();

  break;
  case 6:
  cout<<"\n exit";
  cout<<"loading.............";
  goto start;

  case 7:
  cout<<"\n change status of account";
  r.change();
  break;


  getch();
  break;
  }
  getch();
  }
 break ;
 case 2:
 cout<<"\n\t TRANSACTION:";

 int chm3;
 while(1)
 {

 chm3=menu3();
 switch(chm3)
 {
  case 1:
  cout<<"\n WITHDRAWL";
 z.withdraw1();
  break;
  case 2:
  cout<<"\n DEPOSITE";
    z.deposite();
  break;
  case 3:
  cout<<"\n CALCULATE INTERSEST ";
  z.interest1();
//z.showtraall1();
  break;
  case 4:
  cout<<"\n SHOW BALANCE:";
  r.showall();
 break;
  case 5:
  cout<<"\n EXIT :";
  cout<<"\n loading.............";
  getch();
  goto start;
  }
  getch();
  }
  goto start;
break;
 case 3:
 cout<<"\n\t BALANCE:";
 break;
 case 4:
 cout<<"\n\tREPORT";


 int chm4;
 while(1)
 {

 chm4=menu4();
 switch(chm4)
 {
  case 1:
  cout<<"\n REPORT OF TRA OF all ACC";
 z.showtraall();
  break;
  case 2:
  cout<<"\n REPORT OF TRA ON PARTICULAR account";
   z.report2();
  break;
  case 3:
  cout<<"\n REPORT OF PARTICULAR TRASACTION CODE:";
 z.report3();
  break;
  case 4:
  cout<<"\n REPORT ON PE=ARTICULAR MODE:";
  z.report4();
  break;


   case 6:
  cout<<"\n REPORT ON all the account :";
  r.showall();
  break;

  case 7:
  cout<<"\n REPORT ON dot:";
  z.report5();
  break;

  case 8:
  cout<<"\n REPORT ON INTEREST:";
    report9();
  break;


  case 5:
  cout<<"\n EXIT :";
  cout<<"\n loading.............";
  getch();
  goto start;
  }
  getch();
  }
  goto start;
break;

 case 5:
 cout<<"Thanx for using s/w..."<<endl<<"loading...................";
 cout<<endl<<"now press any key to continue";
 getch();
 exit(0);
 case 6:
 remove("d:\\turboc3\\prob1.bin");
 remove("d:\\turboc3\\joint.bin");
 remove("d:\\turboc3\\tra.bin");
 break;

  }
 getch();
 }
 getch();

}



 /*
struct inter
{

 int a_cc;
 int tra_code;
 char do_t[100];
 int amo_unt;
 char mo_de[100];
 int ba_l;

 public:
 void getint();
 void showint();
 fstream x;
};

void inter::getint()
{

 cout<<"Enter acc No : "; cin>>a_cc;
 cout<<"Enter tracode: ";
 tracode=   transactioncode;
 transactioncode++;
 cout<<tracode;

 cout<<"Enter do_t : ";gets(do_t);
 cout<<"Enter amount: ";cin>>amount;
 cout<<"enter mode:";
 gets(mode);
 if(strcmp(mode,"cheq")==0)
 {
  cout<<"transfer by cheq:";
  cout<<"\n enter cheque no";gets(cheqno);
  cout<<"\n enter date of cheque"; gets(docheq);
  cout<<"\n enter bank name";   gets(bank);
  cout<<"\n enter branch"; gets(branch);


 }

 if(strcmp(mode,"dd")==0)
{
cout<<"\n transfer by demand draft:";
cout<<"\n enter demand draft no:";gets(ddno);
cout<<"\n enter demand draft date";gets(dodd);
 }
  if(strcmp(mode,"translip")==0)
 {
  cout<<"transfer by transfer slip:";

 }
       if(strcmp(mode,"atm")==0)
 {
  cout<<"transfer by atm:";
 }

}

void trans::showtra()
{
cout<<"acc no is:";cout<<acc;
cout<<"tracode is"; cout<<tracode;
cout<<"dot:"; puts(dot);
cout<<"amount"; cout<<amount;
cout<<"mode:"; puts(mode);
if(strcmp(mode,"cheq")==0)
 {
  cout<<"transfer by cheq:";
  cout<<"\n  cheque no";puts(cheqno);
  cout<<"\n  date of cheque"; puts(docheq);
  cout<<"\n  bank name";   puts(bank);
  cout<<"\n  branch"; puts(branch);


 }

  if(strcmp(mode,"dd")==0)
 {
  cout<<"transfer by demand draft:";
  cout<<"\n demand draft no:";puts(ddno);
 cout<<"\n demand draft date";puts(dodd);
}
}


class transaction
{
trans t;
mem s;
long bal;

int rec;
node *start;
public:
transaction()
{
 start=NULL;
} */

0 comments: