Personal Finance 1.0.0
An application that allows you to track/store/view finances, as well as calculate different financial values.
Income Class Reference

This class is used to store income objects. More...

#include <Income.h>

Inheritance diagram for Income:
Money

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...
 
- Public Member Functions inherited from Money
 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 Public Member Functions inherited from Money
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...
 

Detailed Description

This class is used to store income objects.

It is used by other classes to store income objects as a date and amount.

Author
Dawson Dauphinais

Constructor & Destructor Documentation

◆ Income() [1/2]

Income::Income ( string  d,
Money  m 
)

Constructor based on a date and monetary amount.

Parameters
dThe date of the income.
mThe Money amount of the income.
Author
Dawson Dauphinais

◆ Income() [2/2]

Income::Income ( Money  m)
explicit

Constructor based on a monetary amount.

Author
Dawson Dauphinais
Parameters
mThe Money amount of the income.

Member Function Documentation

◆ getAmount()

Money Income::getAmount ( )

Returns the amount of the income.

Returns
A Money object containing the amount of the income.
Author
Dawson Dauphinais

◆ getDate()

string Income::getDate ( )

Returns the date of the income.

Returns
The date of the income.
Author
Dawson Dauphinais

◆ setAmount()

void Income::setAmount ( Money  m)

Sets the amount of the income.

Parameters
mA Money object containing the amount.
Author
Dawson Dauphinais

◆ setDate()

void Income::setDate ( string  d)

Sets the date of the income.

Parameters
dThe date.
Author
Dawson Dauphinais

◆ toString()

void Income::toString ( )

Converts the income object into a string.

Used mainly for debugging purposes.

Author
Dawson Dauphinais