Add Wallet header file
This commit is contained in:
21
CM2005 Object Oriented Programming/Topic 5/5.1.3/Wallet.h
Normal file
21
CM2005 Object Oriented Programming/Topic 5/5.1.3/Wallet.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
|
class Wallet
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Wallet();
|
||||||
|
/** insert currency to the wallet */
|
||||||
|
void insertCurrency(std::string type, double amount);
|
||||||
|
|
||||||
|
/** check if the wallet contains at least this much currency */
|
||||||
|
bool containsCurrency(std::string type, double amount);
|
||||||
|
|
||||||
|
/** generate a string representation of the wallet */
|
||||||
|
std::string toString();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::map<std::string, double> currencies;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user