1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
#include <iostream> using namespace std; class account { public: int balance; account(int ); void credit(int ); void debit(int ); int getbalance(); void printbalance(); }; account::account(int i) { if (i<0) { balance=0; cout<<"Error=>>Value of balance is negative"; } else { i=balance; } } void account::credit(int j) { balance += j; } void account::debit(int k) { if (k>balance) { cout<<"Error :Taking Money is more from Total Money"; } else { balance -= k; } } int account::getbalance() { return balance; } void account::printbalance() { cout<<balance; } int main() { int i,j,k; cin >> i>>j>>k; account ac(i) ; ac.credit(j); ac.printbalance(); ac.debit(k); ac.printbalance(); cin.get(); cin.get(); }