#include <iostream>
#include <iomanip>
#include <ctime>
#include <cmath>
#include <algorithm>
#include <string>
#define ll long long
using namespace std;
class banking_sys
{
private:
string owner;
double balance;
public:
// settr owners name
void set_owner(string owner)
{
this->owner = owner;
}
// gettr owners name
string get_owner()
{
return owner;
}
// settr acc money
void set_balance(double balance)
{
if (balance > 0)
{
this->balance = balance;
}
else
{
cout << "Sorry, your account is empty." << " \U0001F494 " << endl;
}
}
// gettr acc money
double get_balance()
{
return balance;
}
// add to acc
void add_money (double added)
{
cout << "your balance now is : " << balance << "\n";
balance += added;
cout << "The mony that was added is: " << added << "\n";
cout << "your balance becomes : " << balance << "\n";
}
// to take mony
void take_money(double taken)
{
if (taken > balance)
{
cout << "5aleek mo7tarm mtb2ash 7aramy. " << "\n";
}
else if (taken <= balance)
{
cout << "you took : " << taken << "\n";
if (taken == balance)
{
cout << "Now, your account is empty." << "\n";
}
else if (taken < balance)
{
cout << "Now, your account is : " << balance - taken << "\n";
}
}
}
banking_sys (string owner, double balance) :owner (owner), balance(balance)
{
cout << "Hello, we are happy for banking with us." << " \U0001F60D " << endl;
}
~banking_sys()
{
cout << "Thank you for banking with us " << "\U0001F60D" << "\n";
}
};
int main() {
string owner;
double balance;
cin >> owner >> balance;
banking_sys customer1(owner, balance);
customer1.set_balance(balance);
// to confirm yes = 1 or no = 0
bool choice;
cout << "Do you want to add mony ? \n";
cin >> choice;
if (choice == 1)
{
double added;
cout << "enter how much do you want to add :\n";
cin >> added;
customer1.add_money(added);
}
else if (choice == 0)
{
cout << "Ok, for taking mony enter how much do you want to take \n";
double taken;
cin >> taken;
customer1.take_money(taken);
}
return 0;
}