# Timber Volume Calculator

 Chris Headhouse · May 30, 2014 Had an assignment in my programming course to make a console program that calculates the volume of a timber.This was for the purpose of learning about functions, so I thought I'd share my completion of the assignment.All this thanks to Bucky's very much helpful C++ tutorials. Working on a translator atm. too, might post it here later on.The code:Main.cpp#include #include "VolCalc.h"using namespace std;double pi = 3.14159265359;int main(){    VolCalc aNObj;    float a;    float b;    float c;        cout << "State base diameter in meters:" << endl;        cin >> a;        cout << "State top diameter in meters:" << endl;        cin >> b;        cout << "State length in meters:" << endl;        cin >> c;        cout << "The volume of the timber is: " <#include "VolCalc.h"using namespace std;VolCalc::VolCalc(){} double VolCalc::addNumbers(float bd, float td, float length){        double volym = (((bd/2)* (bd/2)+ (td/2) * (td/2) + (bd/2*td/2))/3*pi*length); //the algorithm for the actual calculation        return volym;    }

## Replies

Nothing to see here.

## C++

129,693 followers