You are on page 1of 2

//NAME:M.

PAVANI
//ROLL NO:1772056
BRANCH:ECE.A
//DATE:04.02.2020
//TITLE:ACCOUNT DETAILS OF N NUMBERS
#include<iostream.h>
#include<conio.h>
#include<string.h>
class bank
{
char name[20];
int ano;
char atype[20];
float bal;
public:
void get(int no,char*n,char*t,float b)
{
strcpy(name,n);
ano=no;
strcpy(atype,t);
bal=b;
}
float deposit()
{
float amt;
cout<"enter amount";
cin>>amt;
bal=bal+amt;
return bal;
}
float withdraw()
{
float amt;
cout<<"how many rupees withdraw";
cin>>amt;
bal=bal-amt;
return bal;
}
void disp()
{
cout<<"account no:"<<ano;
cout<<"name:"<<name;
cout<<"account type:"<<atype;
cout<<"after withdraw amount balance:"<<withdraw();
}
};
void main()
{
int n,i,d;
char nm[20],t[20];
float a;
bank bk;
clrscr();
cout<<"enter number of account holders";
cin>>d;
for(i=1;i<=d;i++)
{
cout<<"enter account number";
cin>>n;
cout<<"enter name";
cin>>nm;
cout<<"enter account type:";
cin>>t;
cout<<"enter balance amount";
cin>>a;
bk.get(n,nm,t,a);
bk.disp();
getch();
}
}

You might also like