/* The purpose of this program is to find two numbers and add them together, then divide by two
to get their average value. However, the program must accept and process both float and long variables */
float average(long, long); //These three prototypes describe the overloaded function "average".
float average(float, float);
float average(float, long);
long a; //The following four variables attempt to ensure that the input can be either float or long.
short end; /*I use the 'end' variable to ensure that the program does not close prematurely.
it is not part of the actual program.*/
std::cout<<"This program averages two integers.\n Please input the first value.";
std::cin<<a || b; /*I attempted to use the operator "or" to ensure that if the input is a long variable
then the program will receive it, as well as limit it if the input is only a long variable.
However, an error occurs here "no match for 'operator<<' in 'std::cin<< a'" and the same for c.*/
std::cout<<"\n Please input the second value.\n";
std::cin<<c || d;
a || b == x, c || d == y; /*The point here was to set the received variables as x and y so that
they could be applied into the 'z' variable without an ambiguity error.*/
z = average(x,y); /*The largest problem here is that I cannot define x, y or z without giving them
a data type. To do so would be to compromise the purpose of the program, whereas the return would
be restricted to a single data type.*/
std::cout<<"The average of the two integers is" << z << "\n.";
std::cout<<"Input any value to end.\n";
float average //describes average function