All pastes #2086322 Raw Edit

Anonymous

public text v1 · immutable
#2086322 ·published 2011-10-02 21:11 UTC
rendered paste body
//==========================================================================
//This program is designed to evaulate the value of CloudTools Inc. and also
//assess the sensitivity of the value based on small changes in growth rate.
//Written by Nicholas Gottschlich, Semptember 20th, 2011
//==========================================================================

#include <iostream>
#include <cmath>
using namespace std;

//This procedure displays the intro text on the user's screen.
void showIntro()
{
	cout << "-----------------------------------------" << endl << endl; 		
        cout << "Welcome to the CloudTools Valuation Tool" << endl << endl;
	cout << "Copyright Wolverines & Co. All Rights Reserved."<< endl;
	return;
}

//Takes in a percentage and converts in to a fractional value.
double percentageToFraction(double growthRate)
{
	double decimalValue;
	decimalValue = growthRate / 100;
	return decimalValue;
}

//Calculates and returns weighted average cost of capital based on d to v ratio
double calculateWACC(double DebtToValueRatio)
{
	double Tc = .35;
	double rd = .06;
	double re = .11;
	double debt, value;
	double WACC;
	WACC = (DebtToValueRatio) * rd * (1-Tc) + (1 - DebtToValueRatio) * re;
	return WACC;
}	

//Calculates the present value of horizon period using the given WACC and growth rate, result is stored as final argument
void calculatePVhorizonPeriod(double WeightedAverageCostCapital, double growthRate, double & valueOfHorizonPeriod)
{
	double freeCashFlow6 = 20;
	valueOfHorizonPeriod = (1 / pow((1 + WeightedAverageCostCapital),5)) * freeCashFlow6 / (WeightedAverageCostCapital - growthRate);
	return;
}

//calculates the present value of forecast period using the given WACC, stores as final argument
void calculatePVforecastPeriod(double WeightedAverageCostCapital, double & valueOfForecastPeriod)
{
	double FCF1 = 10;
	double FCF2 = 12;
	double FCF3 = 14;
	double FCF4 = 16;
	double FCF5 = 18;
	valueOfForecastPeriod = FCF1 / (1 + WeightedAverageCostCapital) + FCF2 / pow((1 + WeightedAverageCostCapital),2) + FCF3 / pow((1 + WeightedAverageCostCapital),3) + FCF4 / pow((1 + WeightedAverageCostCapital),4) + FCF5 / pow((1+ WeightedAverageCostCapital),5);
	return;
}

//takes present value of forecast and horizon period and returns sum as total value of business
double calculateValueOfBusiness(double valueOfForecastPeriod, double valueOfHorizonPeriod)
{
	double ValueOfBusiness;
	ValueOfBusiness = valueOfForecastPeriod + valueOfHorizonPeriod;
	return ValueOfBusiness;
}

//calculates 3 sensitivity values, given inputs for firm value, WACC, original growth rate, and present value for FP and HP, then stores results for 5, 10 and 20 basis points
void calculateSensitivity(double FirmValue, double WeightedAverageCostCapital, double valueOfHorizonPeriod, double valueOfForecastPeriod, double growthRate, double & Sensitivity5, double & Sensitivity10, double & Sensitivity20)
{
	double newgrowthRate1, newgrowthRate2, newgrowthRate3;
	double newfirmvalue1, newfirmvalue2, newfirmvalue3;
	newgrowthRate1 = growthRate + .0005;
	calculatePVhorizonPeriod(WeightedAverageCostCapital, newgrowthRate1, valueOfHorizonPeriod);
	newfirmvalue1 = valueOfHorizonPeriod + valueOfForecastPeriod;
	Sensitivity5 = newfirmvalue1 - FirmValue;
	
	newgrowthRate2 = growthRate + .0010;
	calculatePVhorizonPeriod(WeightedAverageCostCapital, newgrowthRate2, valueOfHorizonPeriod);
	newfirmvalue2 = valueOfHorizonPeriod + valueOfForecastPeriod;
	Sensitivity10 = newfirmvalue2 - FirmValue;
	
	newgrowthRate3 = growthRate + .0020;
	calculatePVhorizonPeriod(WeightedAverageCostCapital, newgrowthRate3, valueOfHorizonPeriod);
	newfirmvalue3 = valueOfHorizonPeriod + valueOfForecastPeriod;
	Sensitivity20 = newfirmvalue3 - FirmValue;	
	return;
}

int main()
{
	double growthRate;
	double Tc = .35;
	double rd = .06;
	double re = .11;
	double debt, value;
	double dvratio;
	double WACC;
	double PVHP, PVFP;
	double Sensitivity5, Sensitivity10, Sensitivity20;
	double ValueOfBusiness;
	//show intro
	showIntro();
	//user input
	cout << "Enter the Growth Rate (g) of CloudTools as a Percentage (Between 0% and 3%):" << endl;
	cin >> growthRate;
	//converts percent to decimal
	growthRate = percentageToFraction (growthRate);
	//user input
	cout << "Enter the Debt to Value ratio (D/V) of CloudTools (Between 0 and 1):" << endl;
	cin >> dvratio;
	//calculates WACC
	WACC = calculateWACC (dvratio);
	//calculates PVHP
	calculatePVhorizonPeriod(WACC, growthRate, PVHP);
	//calculates PVFP
	calculatePVforecastPeriod(WACC, PVFP);
	//returns the total value of the business to user
	cout << "The value of CloudTools is:$" << calculateValueOfBusiness(PVFP, PVHP) << "Million" << endl;
	ValueOfBusiness = calculateValueOfBusiness(PVFP, PVHP);
	//calculates sensitivity for .05, .10, and .20 percent increase in growthRate
	calculateSensitivity(ValueOfBusiness, WACC, PVHP, PVFP, growthRate, Sensitivity5, Sensitivity10, Sensitivity20);
	cout << "The Sensitivity due to a 5 basis point increase in the growth rate is:$" << Sensitivity5 << endl << "Million" << endl; 
	cout << "The Sensitivity due to a 10 basis point increase in the growth rate is:$" << Sensitivity10 << endl << "Million" << endl; 
	cout << "The Sensitivity due to a 20 basis point increase in the growth rate is:$" << Sensitivity20 << endl << "Million" << endl;
	return 0;
}