Untitled
unknown
plain_text
2 years ago
2.0 kB
4
Indexable
#include<iostream> #include<string> using namespace std; long long int def=1; class bank{ private: string name; long long int acc; string type; long double bal; float rate; public: bank(){ cout<<"**** Welcome to HDFC Bank Account Opening Process ****\n\n"; cout<<"Enter the Name of Account Holder: "; getline(cin,name); cout<<"\nAccount Holder Name: "<<name; acc=100000+def; def++; cout<<"\nYour Account Number is: "<<acc; int tmp=0; do{ int a; cout<<"\n\nWhat type of account do you want:\nEnter 1 for Savings\nEnter 2 for Current\n"; cin>>a; if(a==1){ type="Savings"; tmp=1; } else if(a==2){ type="Current"; tmp=2; } else{ cout<<"Please enter correct option."; } } while(tmp==0); cout<<"Type of Account: "<<type; bal=0; cout<<"\n\nAvailable Balance: "<<bal; rate=4.00; cout<<"\nRate of Interest: "<<rate; } bank(string a,long long int b,string c,long double d,float e){ name=a; acc=b; type=c; bal=d; rate=e; cout<<"\nAccount Holder Name: "<<name; cout<<"\nYour Account Number is: "<<acc; cout<<"\nType of Account: "<<type; cout<<"\nAvailable Balance: "<<bal; cout<<"\nRate of Interest: "<<rate; } void dep(){ long double a; cout<<"\nEnter the Amount you want to deposit: "; cin>>a; bal=bal+a; cout<<"\nDeposit Successful, After deposit your Available Balance is : "<<bal<<endl; } void checkbal(){ cout<<"\nThe available balance in your account is : "<<bal<<endl; } void display(){ cout<<"\n\nName of Depositor: "<<name; cout<<"\nAccount Number: "<<acc; cout<<"\nType of Account: "<<type; cout<<"\nAvailable Balance: "<<bal; cout<<"\nRate of Interest: "<<rate; } void display_rate(){ cout<<"\nThe Rate of Interest on your Account is : "<<rate<<endl; } }; int main(){ bank c1; c1.display(); c1.dep(); return 0; }
Editor is loading...