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

The Expense class is used to perform various operations on an Expense object. More...

#include <Expense.h>

Inheritance diagram for Expense:
Money

Public Member Functions

void setValues (string n, Money &p, string t, string d, bool iR)
 Sets the values of the Expense object. More...
 
void setName (string name)
 Sets the name of the Expense. More...
 
void setPrice (Money price)
 Sets the price of the Expense. More...
 
void setType (string type)
 Sets the type of the Expense. More...
 
void setDate (string date)
 Sets the date of the Expense. More...
 
void setIsRecurring (bool isRecurring)
 Sets whether the Expense is recurring or not. More...
 
string getName ()
 Returns the name of the Expense. More...
 
Money getPrice ()
 Returns the price of the Expense. More...
 
string getType ()
 Returns the type of the Expense. More...
 
string getDate ()
 Returns the date of the Expense. More...
 
bool getIsRecurring () const
 Returns whether the Expense is recurring or not. More...
 
void printValues ()
 Prints the values currently stored in the Expense object. More...
 
string toString ()
 Converts the Expense 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

The Expense class is used to perform various operations on an Expense object.

The Expense class contains several functions pertaining to interacting with an Expense. It is used by the Account class when adding transactions to an account.

Author
Dawson Dauphinais

Member Function Documentation

◆ getDate()

string Expense::getDate ( )

Returns the date of the Expense.

Returns
The date of the expense.
Author
Dawson Dauphinais

◆ getIsRecurring()

bool Expense::getIsRecurring ( ) const

Returns whether the Expense is recurring or not.

Returns
Whether the expense is recurring or not.
Author
Dawson Dauphinais

◆ getName()

string Expense::getName ( )

Returns the name of the Expense.

Returns
The name of the expense.
Author
Dawson Dauphinais

◆ getPrice()

Money Expense::getPrice ( )

Returns the price of the Expense.

Returns
The price of the expense.
Author
Dawson Dauphinais

◆ getType()

string Expense::getType ( )

Returns the type of the Expense.

Returns
The type of the expense.
Author
Dawson Dauphinais

◆ printValues()

void Expense::printValues ( )

Prints the values currently stored in the Expense object.

Used mainly for debugging purposes.

Author
Dawson Dauphinais

◆ setDate()

void Expense::setDate ( string  date)

Sets the date of the Expense.

Parameters
dateThe date of the expense.
Author
Dawson Dauphinais

◆ setIsRecurring()

void Expense::setIsRecurring ( bool  isRecurring)

Sets whether the Expense is recurring or not.

Parameters
isRecurringWhether the expense is recurring or not.
Author
Dawson Dauphinais

◆ setName()

void Expense::setName ( string  name)

Sets the name of the Expense.

Parameters
nameThe name of the expense.
Author
Dawson Dauphinais

◆ setPrice()

void Expense::setPrice ( Money  price)

Sets the price of the Expense.

Parameters
priceThe price of the expense.
Author
Dawson Dauphinais

◆ setType()

void Expense::setType ( string  type)

Sets the type of the Expense.

Parameters
typeThe type of expense.
Author
Dawson Dauphinais

◆ setValues()

void Expense::setValues ( string  n,
Money p,
string  t,
string  d,
bool  iR 
)

Sets the values of the Expense object.

Parameters
nThe name of the expense.
pThe price of the expense.
tThe type of expense.
dThe date of the expense.
iRWhether the expense is recurring or not.
Author
Dawson Dauphinais

◆ toString()

string Expense::toString ( )

Converts the Expense object into a string.

Returns
A string format of the expense object.
Author
Dawson Dauphinais