Untitled
unknown
plain_text
2 years ago
1.9 kB
7
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 long float bal;
float rate;
public:
bank(){
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{
cout<<"\nWhat type of account do you want:\nEnter 1 for Savings\nEnter 2 for Current\n";
cin>>tmp;
if(tmp==1){
type="Savings";
}
else if(tmp==2){
type="Current";
}
}
while(tmp==0);
cout<<"\nType of Account: "<<type;
bal=0;
cout<<"\nAvailable Balance: "<<bal;
rate=4.00;
cout<<"\nRate of Interest: "<<rate;
}
bank(string a,long long int b,string c,long long float 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 long float 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<<"\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...