#include #include #include #include using namespace std; void SimpleFunction(); int Cubed(int); void GetCube(); int Power(int,int); void GetPowers(); void CreateArray(); void PopulateArray(int arr[], int size); void DisplayArray(const int arr[], int size); struct Person { string firstName; string lastName; int age; }; void CreateStructure(); void DisplayStructure(const Person * p1); //these functions are for function pointers int Add(int,int); int Subtract(int, int); int Mult(int, int); void DoMath(int,int, int (*pFunction)(int,int)); void UseDoMath(); int main() { //SimpleFunction(); //GetCube(); //GetPowers(); //CreateArray(); //CreateStructure(); UseDoMath(); system("PAUSE"); } void SimpleFunction() { cout << "This is a simple function " << endl; } void GetCube() { cout <<"Enter a Number" << endl; int number; cin>> number; cout << "The cube of " << number << " is " << Cubed(number) << endl; } int Cubed(int number) { return number * number * number; } void GetPowers() { int num, pow; cout << "Enter a number" << endl; cin >> num; cout << "Enter the exponent" << endl; cin >> pow; cout << num << " to the " << pow << " Equals " << Power(num, pow)<firstName << endl; cout<< p1->lastName << endl; cout << p1->age <> num1; cout << "Enter the second number " <>num2; cout << " the sum is " ; DoMath(num1, num2,Add); cout << "The Difference is "; DoMath(num1, num2, Subtract); cout << "The product is "; DoMath(num1, num2, Mult); cout << "The exponent is "; DoMath(num1, num2, Power); }