Compute Min and Max using reference (const int) functions

I am writing a code that takes the two values you entered and determines which is the min and which is the max, The only problem is we are supposed to have exactly two formal parameters, each of type “reference to const double”;
amd return type “reference to double” (not “reference to const double”); in each function and I am really confused on how to write the code!! my Main code is:

#include<iostream>
using namespace std;

const double ComputeMinimum(const double num1, const double num2);
const double ComputeMaximum(const double num1,const double num2);

int main(void)
{
double num1, num2;

cout << "enter any space-separated pair of decimal numeric values on the same line: ";
cin >> "%lf%lf", &num1, &num2;

cout << "ComputeMinimum(%f, %f) returned %f\n" << num1 << num2 << ComputeMinimum(num1, num2);
cout <<"ComputeMaximum(%f, %f) returned %f\n" << num1 << num2 << ComputeMaximum(num1, num2);


return EXIT_SUCCESS;
}


and my two functions are:

const double ComputeMinimum(const double & num1,const double & num2) {

return ComputeMinimum = (&num1 < &num2) ? num1 : num2;

}

and:

const double &ComputeMaximum(const double &num1, const double &num2) {



return ComputeMaximum = (&num1 > &num2) ? &num1 : &num2;

}

all help is needed. then after this I have the same project but am using pointers instead of reference. Is that much different?
Topic archived. No new replies allowed.