// protos.cpp -- use prototypes and function calls
#include <iostream>

void cheers(int);       // prototype: no return value
                        // you can just list the type, tho better to include
                        // the variable like below...
double cube(double x);  // prototype: returns a double

int main(void)
{
    using namespace std;
    cheers(5);          // function call
    cout << "Give me a number: ";
    double side;
    cin >> side;
    double volume = cube(side);    // function call
    cout << "A " << side <<"-foot cube has a volume of ";
    cout << volume << " cubic feet.\n";
    cheers(cube(2));    // prototype protection at work
    return 0;
}

void cheers(int n)
{
    using namespace std;
    for (int i = 0; i < n; i++)
        cout << "Cheers! ";
    cout << endl;
}

// notice the double return type... will return a value of double to where
// it was called
double cube(double x)
{
    return x * x * x; 
}

