Write a program to perform bank transactions – C++ OOP’s In Hindi

C++

Write a program to perform bank transactionsC++ OOP’s Program In Hindi – Aaj Ham C++ OOPs Me Ek Bank Transactions Program Ko Create Karne Wale Hai.

Also Read – Classes & Object & Data Members Etc

Write a program to perform bank transactions

Is Program Me Ham Ek Class Bank Create Karenge Or Uske Under Ham Sabhi Method Yani Function Ko Likhne Wale Hai |

Isme Ham Input Me User Se Bank Account Details Lenge And Fir Bank Transaction Kar Ke Sath Output Me Show Karenge |

Shopping List Program

Example:

#include<iostream>
#include<iomanip>
#include<string>
using namespace std;
class Bank
{
  private:
    int Accno;
    string AccName;
    char AccType;
    float BalanceAmt;
  public:
  void getAccountDetails()
  {
    cout<<"Please enter account details:"<<endl;
    cout<<"Account Number:";
    cin>>Accno;
    cout<<"Account Holder Name:";
    cin>>AccName;
    cout<<"AccountType(c-Current,s-Savings):";
    cin>>AccType;
    cout<<"Balance Amount:";
    cin>>BalanceAmt;
  }
  void printAccountDetails()
  {
    cout<<"Account holder details:"<<endl;
    cout<<"....................."<<endl;
    cout<<"Account Number:"<<Accno<<endl;
    cout<<"Name:"<<AccName<<endl;
    cout<<"Account type:"<<AccType<<endl;
    cout<<"Balance Amount:"<<BalanceAmt<<endl;
	cout<<".............."<<endl;
  }
  void doTransaction()
  {
    char type;
    float tamt;
    cout<<"Transation Process"<<endl;
    cout<<"..........."<<endl;
    cout<<"Get transatioin amount:";
    cin>>tamt;
    cout<<"Get transation type(W-withdrawl,D.deposite):";
    cin>>type;
    if(type=='W'||type=='w')
	{
		if (BalanceAmt-tamt>0)
		{
			BalanceAmt = BalanceAmt-tamt;
            cout<<"Transation completed"<<endl;
            cout<<"Your current Balance is"<<BalanceAmt<<endl;
         }
       else
        {
         cout<<"Sorry! Insufficient funds in your account."<<endl;
     	}
    }
    else if(type=='D'||type=='d')
    {
        BalanceAmt=BalanceAmt+tamt;
        cout<<"Your current Balance is"<<BalanceAmt<<endl;}
    }
};
int main()
{
Bank B;
B.getAccountDetails();
cout<<"............."<<endl;
cout<<"Account Details Before Transation"<<endl;
B.printAccountDetails();
B.doTransaction();
cout<<"...................."<<endl;
cout<<"Account Details after Transation"<<endl;
B.printAccountDetails();
return 0;
}

Output:

Please enter account details:
Account number:1001
Account holder name: Arshad
Account type (C-current,S-savings): C
Balance Amount:5000
-------------------
Account details before transaction
Account holder details...
-------------------
Account Number:1001
Name: Arshad
Account type: C
Balance amount:5000
-------------------
Transaction Process
-------------------
Get transaction amount:2000
Get transaction type(W- withdrawal, D-deposit):W
Transaction completed
Your current balance is 3000
-------------------
Account details after transaction
Account holder details...
-------------------
Account Number:1001
Name: Arshad
Account type:C
Balance Amount:3000

Aap Upper Output Ko Dekh Kar Program Ko Understand Kar Sakte Hai, isme Hame Bank Details And Fir Unke Value Ko Input Karaya Hai, Uske Bad Hame Unhe Print Kar Diya Hai |

Leave a Reply

Your email address will not be published.