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
17using namespace std;
18
23class Formulas : public Money
24{
25public:
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
The Formulas class is used to calculate different financial values.
Definition: formulas.h:24
static double leverageRatio(Money &totalLiabilities, Money &totalDebts, Money &totalIncome)
Calculates a leverage ratio.
static double compoundAnnualGrowthRate(Money &beginningVal, Money &endingVal, int numPeriods)
Calculates the rate an investment would grow if the rate were constant.
static double creditCardEquation(Money balance, Money monthlyPayment, double interestRate)
Determines how long it will take to pay off a credit card.
static Money cashFlow(Money &income, Money &expenses)
Calculates total cash flow.
static Money futureValueOrdinaryAnnuity(Money &payment, double interestRate, int numPayments)
Calculates the future value of an ordinary annuity.
Formulas()
Default constructor for the Formulas class.
static double ruleOfSeventyTwo(double interestRate)
Implements the Rule of 72.
static Money amortization(Money principal, double interestRate, int numPeriods, int paymentsPerPeriod)
Calculates how much a monthly payment on will be on a debt.
The Money class is used to allow operations on Money.
Definition: Money.h:27