0% found this document useful (0 votes)
9 views2 pages

Bank Program

hdvflwfh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Bank Program

hdvflwfh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include<iostream.

h> //header file


#include<conio.h> // header file
#include<stdio.h>
#include<string.h>
char address[100],Branch[100]="XYZ Bank SCO No 12 Near KFC Mohali"; //Global Variables
char account_type;
int digit=0,ld=1,no,flag=0;
class bank //name of class is bank
{
private: //access specifier
float amount_deposit,amount_withdraw,balance; //data memeber
char account_no[14]; //data memeber
char holder_name[30]; //data memeber
public: //access specifier
void enter_details()//Member Function for Enter Details of customer
{
cout<<"Enter your name: ";
gets(holder_name);
cout<<"Enter your address: ";
gets(address);
cout<<"Enter account no: ";
gets(account_no);
cout<<"\nAccount type: 1. Saving Account(s) 2. Current Account(c): ";
cin>>account_type;
digit=strlen(account_no);
if((digit==12)||(digit==14))
{
flag=1;
}
else
{
flag=0;
}
while(flag==0)
{
if((digit==12)||(digit==14))
{
flag=1;
}
else
{
flag=0;
cout<<"\naccount number should be of 12 & 14 digit: ";
cout<<"\nEnter account no Again: ";
cin>>account_no;
}
digit=strlen(account_no);
}
}
void customer_details()//Member Function for Display Details of customer
{
cout<<"\n------------------------------------------------------------------";
cout<<"\nCustomer Name: "<<holder_name;
cout<<"\nAccount No.: "<<account_no;
cout<<"\naccount type: "<<account_type;
cout<<"\nCustomer Address: "<<address;
cout<<"\nBank Address: "<<Branch;
cout<<"\n-------------------------------------------------------------------";
}
};
void main()
{
class bank obj;
clrscr();
obj.enter_details();
obj.customer_details();
getch();
}

You might also like