Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @(#) Account.h
- */
- #ifndef ACCOUNT_H_H
- #define ACCOUNT_H_H
- #include "Coin.h"
- #include "send_recieve.h"
- #include "PropertyHistory.h"
- #include "Wallet.h"
- class Account
- {
- private:
- int accountId;
- float cash;
- PropertyHistory property_history;
- Wallet wallet;
- public:
- Account( int id );
- Account( int id, float cash );
- ~Account( );
- // Buy & Sell
- void sellCoin( Coin coin, int amount );
- void buyCoin( Coin coin, int amount );
- // Cahs
- bool addBalance( float amout );
- bool changeBalance( float amount );
- float chashStatus();
- int getID();
- };
- #endif
- /**
- * @(#) Account.cpp
- */
- #include "Account.h"
- Account::Account( int id )
- {
- this->accountId = id;
- this->cash = 0;
- this->wallet = Wallet();
- this->property_history = PropertyHistory();
- }
- Account::Account( int id, float cash )
- {
- this->accountId = id;
- this->cash = cash;
- this->wallet = Wallet();
- this->property_history = PropertyHistory();
- }
- Account::~Account( )
- {
- }
- /**
- *
- * @param coin
- * @param amount
- */
- void Account::buyCoin( Coin coin, int amount )
- {
- this->wallet.recieveCoin( coin.getName(), amount );
- //this->property_history.addTransaction();
- }
- /**
- *
- * @param coin
- * @param amount
- */
- void Account::sellCoin( Coin coin, int amount )
- {
- this->wallet.sendCoin( coin.getName(), amount );
- }
- /**
- *
- * @param amount
- * @return
- */
- bool Account::changeBalance( float amount )
- {
- this->cash = amount;
- }
- /**
- *
- * @param amout
- * @return
- */
- bool Account::addBalance( float amout )
- {
- this->cash += amout;
- }
- /**
- *
- * @return
- */
- int Account::getID()
- {
- return this->accountId;
- }
- /**
- *
- * @return
- */
- float Account::chashStatus( )
- {
- return this->cash;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement