Personal Finance
1.0.0
An application that allows you to track/store/view finances, as well as calculate different financial values.
formulas.h
Go to the documentation of this file.
1
/*
2
* Author: Dawson Dauphinais
3
* ddauphin@nmu.edu
4
*
5
* Senior Project: Personal Finance System
6
*
7
* date last modified: 11/23/2021
8
*/
9
#ifndef PERSONALFINANCE_FORMULAS_H
10
#define PERSONALFINANCE_FORMULAS_H
11
12
#include <cstdlib>
13
#include <string>
14
#include <cmath>
15
#include "
Money.h
"
16
17
using namespace
std;
18
23
class
Formulas
:
public
Money
24
{
25
public
:
27
Formulas
();
28
35
static
Money
cashFlow
(
Money
&income,
Money
&expenses);
36
46
static
Money
futureValueOrdinaryAnnuity
(
Money
&payment,
double
interestRate,
int
numPayments);
47
56
static
double
compoundAnnualGrowthRate
(
Money
&beginningVal,
Money
&endingVal,
int
numPeriods);
57
67
static
double
leverageRatio
(
Money
&totalLiabilities,
Money
&totalDebts,
Money
&totalIncome);
68
76
static
double
ruleOfSeventyTwo
(
double
interestRate);
77
87
static
double
creditCardEquation
(
Money
balance,
Money
monthlyPayment,
double
interestRate);
88
100
static
Money
amortization
(
Money
principal,
double
interestRate,
int
numPeriods,
int
paymentsPerPeriod);
101
};
102
103
#endif
//PERSONALFINANCE_FORMULAS_H
Money.h
Formulas
The Formulas class is used to calculate different financial values.
Definition:
formulas.h:24
Formulas::leverageRatio
static double leverageRatio(Money &totalLiabilities, Money &totalDebts, Money &totalIncome)
Calculates a leverage ratio.
Formulas::compoundAnnualGrowthRate
static double compoundAnnualGrowthRate(Money &beginningVal, Money &endingVal, int numPeriods)
Calculates the rate an investment would grow if the rate were constant.
Formulas::creditCardEquation
static double creditCardEquation(Money balance, Money monthlyPayment, double interestRate)
Determines how long it will take to pay off a credit card.
Formulas::cashFlow
static Money cashFlow(Money &income, Money &expenses)
Calculates total cash flow.
Formulas::futureValueOrdinaryAnnuity
static Money futureValueOrdinaryAnnuity(Money &payment, double interestRate, int numPayments)
Calculates the future value of an ordinary annuity.
Formulas::Formulas
Formulas()
Default constructor for the Formulas class.
Formulas::ruleOfSeventyTwo
static double ruleOfSeventyTwo(double interestRate)
Implements the Rule of 72.
Formulas::amortization
static Money amortization(Money principal, double interestRate, int numPeriods, int paymentsPerPeriod)
Calculates how much a monthly payment on will be on a debt.
Money
The Money class is used to allow operations on Money.
Definition:
Money.h:27
CS480
PersonalFinance_GUI
include
formulas.h
Generated by
1.9.2