#include <iostream>
#include <cstdlib>
using std::cout;
using std::cerr;
using std::endl;

class BankAccount {
public:
	BankAccount(double);
	~BankAccount();
	
	double getBalance() const;
	
	void deposit(double);
	
	void withdraw(double);

private:
	double balance;
};

int main()
{
	BankAccount sally( 100.0 );
	
	sally.deposit(42.23);
	
	cout << sally.getBalance() << endl;

	return 0;
}

BankAccount::BankAccount( double balance ) :
	balance(balance) {}

BankAccount::~BankAccount() {}

double BankAccount::getBalance() const 
{
	return balance;
}

void BankAccount::deposit(double amt)
{
	balance += amt;
	return;
}

void BankAccount::withdraw(double amt)
{
	if (amt > balance ) {
		cerr << "overdrawn" << endl;
		exit(EXIT_FAILURE);
	}
	else {
		balance -= amt;
		return;
	}
}