Not sure what's wrong...
I keep gettin this error and I don't know how to solve it...
error C2065: 'AveXYZ' : undeclared identifier
can someone help me please?
//-----------------------------------
#include "stdafx.h"
#include <iostream>
#include <cmath>
using namespace std;
//-----------------------------------
float Display(int x, int y, int z);
float ComputeAve(int x,int y,int z);
float FindMax(int x, int y, int z);
float FindMin(int x, int y, int z);
//-----------------------------------
int main()
{
int x, y, z;
//read data into x, y, and z
cout << "Enter 3 integer numbers: ";
cin >> x >> y >> z;
//compute the average of x, y, and z
float AveXYZ;
AveXYZ = ComputeAve(x,y,z);
//Find the maximum of x, y, and z
int maxXYZ;
maxXYZ = FindMax(x,y,z);
//Find the minimum of x, y, and z
int minXYZ;
minXYZ = FindMin(x,y,z);
//Display average, maximum, and minimum
Display(AveXYZ, maxXYZ, minXYZ);
//terminate program
return 0;
}
//-----------------------------------
// Name: ComputeAve
// Input: the average equation
// Output: the average of x,y,z
//-----------------------------------
float ComputeAve(float x, float y, float z)
{
return (x+y+z)/3;
}
//-----------------------------------
// Name: FindMax
// Input: None
// Output: The Maximum
//-----------------------------------
int maxXYZ(int x, int y, int z)
{
if (x > y && x > z)
{return x;}
if (y > x && y > z)
{return y;}
if (z > x && z > y)
{return z;}
}
//-----------------------------------
// Name: FindMin
// Input: None
// Output: The Minimum
//-----------------------------------
int minXYZ(int x, int y, int z)
{
if (x < y && x < z)
{return x;}
if (y < x && y < z)
{return y;}
if (z < x && z < y)
{return z;}
}
//----------------------------------------------
// Name: Display
// Input: None
// Output: display Average, Maximum, and Minimum
//----------------------------------------------
float Display(int x, int y, int z)
{
cout << "\tAverage= " << AveXYZ << endl;
cout << "\tMaximum= " << maxXYZ << endl;
cout << "\tMinimum= " << minXYZ << endl;
return 0;
}