This class is used to store income objects. More...
#include <Income.h>
Public Member Functions | |
Income (string d, Money m) | |
Constructor based on a date and monetary amount. More... | |
Income (Money m) | |
Constructor based on a monetary amount. More... | |
string | getDate () |
Returns the date of the income. More... | |
Money | getAmount () |
Returns the amount of the income. More... | |
void | setDate (string d) |
Sets the date of the income. More... | |
void | setAmount (Money m) |
Sets the amount of the income. More... | |
void | toString () |
Converts the income object into a string. More... | |
![]() | |
Money () | |
Default constructor for the Money class. More... | |
Money (double m) | |
Constructor for the Money class based on a double. More... | |
Money (int d, int c) | |
Constructor for the Money class based on two integers. More... | |
Money (const string &s) | |
Constructor for the Money class based on a string. More... | |
Money | operator- () const |
Overloads the - operator for the Money class. More... | |
Money | operator+ (const Money &m) const |
Overloads the + operator for the Money class. More... | |
Money | operator- (const Money &m) const |
Overloads the - operator for the Money class. More... | |
Money | operator* (double val) const |
Overloads the * operator for the Money class. More... | |
Money | operator/ (double m) const |
Overloads the / operator for the Money class. More... | |
Money | operator/ (Money &m) const |
Overloads the / operator for the Money class. More... | |
bool | operator== (const Money &m) const |
Overloads the == operator for the Money class. More... | |
Additional Inherited Members | |
![]() | |
static Money | power (Money &m, int exp) |
Implements the power function for the Money class. More... | |
static double | power (double d, int exp) |
Helper function for the power function of the Money class. More... | |
static double | toDouble (const Money &m) |
Converts a Money object to a double value. More... | |
static string | toString (const Money &m1) |
Converts a Money object to a string. More... | |
This class is used to store income objects.
It is used by other classes to store income objects as a date and amount.
Income::Income | ( | string | d, |
Money | m | ||
) |
Constructor based on a date and monetary amount.
d | The date of the income. |
m | The Money amount of the income. |
|
explicit |
Constructor based on a monetary amount.
m | The Money amount of the income. |
Money Income::getAmount | ( | ) |
Returns the amount of the income.
string Income::getDate | ( | ) |
Returns the date of the income.
void Income::setAmount | ( | Money | m | ) |
Sets the amount of the income.
m | A Money object containing the amount. |
void Income::setDate | ( | string | d | ) |
Sets the date of the income.
d | The date. |
void Income::toString | ( | ) |
Converts the income object into a string.
Used mainly for debugging purposes.