Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class bank
- {
- public:
- double id, id1;
- double money, money1;
- double acc, acc1, m, t, t1;
- friend int data(bank);
- friend int data1(bank);
- };
- int data(bank i)
- {
- cout << "Enter HDFC account number please: ";
- cin >> i.acc;
- if (i.id1 == i.acc)
- {
- cout << "[your account number is match]";
- cout << "\nEnter money to transfer: ";
- cin >> i.m;
- if (i.m <= i.money)
- {
- cout << "[Money has been successfully transfer]\n";
- i.t = i.money - i.m;
- cout << "-----------------SBI DETAIL---------------\n";
- cout << "SBI Account No |" << i.id << endl
- << "Previous Balance |" << i.money << endl;
- cout << "Transfered Money |" << i.m << endl
- << "Available Balance |" << i.t << endl;
- cout << "--------------------------------------------\n";
- i.t = i.money1 + i.m;
- cout << "-----------------HDFC DETAIL----------------\n";
- cout << "HDFC Account No |" << i.id1 << endl
- << "Previous Balance |" << i.money1 << endl;
- cout << "Received Money |" << i.m << endl
- << "Available Balance |" << i.t << endl;
- cout << "--------------------------------------------\n";
- }
- else
- {
- cout << "That Much Money not available in your account\n";
- }
- }
- else
- {
- cout << "Enter valid account number\n";
- }
- }
- int data1(bank i)
- {
- cout << "Enter SBI account number please\n";
- cin >> i.acc;
- if (i.id == i.acc)
- {
- cout << "[your account number is match]\n";
- cout << "Enter money to transfer \n";
- cin >> i.m;
- if (i.m <= i.money1)
- {
- cout << "[Money has been successfully transfer]\n";
- i.t1 = i.money1 - i.m;
- cout << "-----------------HDFC DETAIL----------------\n";
- cout << "HDFC Account No |" << i.id1 << endl
- << "Previous Balance |" << i.money1 << endl;
- cout << "Transfered Money |" << i.m << endl
- << "Available Balance |" << i.t1 << endl;
- cout << "--------------------------------------------\n";
- i.t1 = i.money + i.m;
- cout << "-----------------SBI DETAIL---------------\n";
- cout << "SBI Account No |" << i.id << endl
- << "Previous Balance |" << i.money << endl;
- cout << "Received Money |" << i.m << endl
- << "Available Balance |" << i.t1 << endl;
- cout << "--------------------------------------------\n";
- }
- else
- {
- cout << "That Much Money not available in your account\n";
- }
- }
- else
- {
- cout << "Enter valid account number\n";
- }
- }
- int main()
- {
- bank i;
- cout << "Set account number for SBI: ";
- cin >> i.id;
- cout << "\nEnter money in SBI bank account: ";
- cin >> i.money;
- cout << "\nSet account number for HDFC: ";
- cin >> i.id1;
- cout << "\nEnter money in HDFC bank account: ";
- cin >> i.money1;
- cout << "-------------------------\n";
- cout << "SBI Account No |" << i.id << endl
- << "Available Balance |" << i.money << endl;
- cout << "HDFC Account No |" << i.id1 << endl
- << "Available Balance |" << i.money1 << endl;
- cout << "-------------------------\n";
- int ch;
- cout << "\n1.SBI to HDFC\n";
- cout << "2.HDFC to SBI\n";
- cout << "Select Bank to transfer money: ";
- cin >> ch;
- switch (ch)
- {
- case 1:
- data(i);
- break;
- case 2:
- data1(i);
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement