HBL Bank requires account management software. The branch manager met with the software engineers and
discussed the details/requirements. According to him, the bank needs to store account title (name), account
number, account type and balance for each account entry. You can deposit and withdraw amount. You are required
to provide a library that can be utilized in the management system.
#include<iostream>
using namespace std;
class HBL{
private:
string title;
int account_number;
string account_type;
double balance;
public:
void input(){
cout<<"Enter account title: ";
cin>>title;
cout<<"Enter account number: ";
cin>>account_number;
cout<<"Enter account type: ";
cin>>account_type;
cout<<"Enter account balance: ";
cin>>balance;
}
void deposit(double amount){
cout<<"Amount deposited successfully\n: Your current balance is: "<<balance + amount<<endl;
}
void withdraw(double amount){
if(balance>amount){
cout<<"Withdrawal successful: \n Your current balance is: "<<balance-amount;
}
else{
cout<<"Insufficient funds in your account "<<endl;
}
}
};
int main(){
HBL b;
b.input();
b.deposit(10000);
}
Comments
Leave a comment