### NEED HELP ASAP!

#include <iostream>
#include <cstring>

using namespace std;

// GLOBAL CONSTANTS
double highestsales;
double northeast;
double southeast;
double northwest;
double southwest;
//double largest;

// FUNCTIONS PROTOTYPES
double getSales(double northeast, double southeast , double southwest , double northwest);
void find_Highest(double & northeast , double & southeast , double & southwest, double & northwest);

int main()
{
cout << "Enter NorthEast sales: \$" ;
cin >> (northeast);
cout << "Enter SouthEast sales: \$";
cin >> (southeast);
cout << "Enter NorthWest sales: \$";
cin >> (northwest);
cout << "Enter SouthWest sales: \$";
cin >> (southwest);

//getSales(northeast, southeast, northwest, southwest);
find_Highest(northeast ,southeast, southwest, northwest);
return highestsales;
system("PAUSE");

return EXIT_SUCCESS;
}

double getSales (double northeast, double southeast , double southwest , double northwest)

{
cout << "Enter the quarterly sales for the Northeast division: ";
cin >> northeast ;
while (northeast <=0)
{
cout << "Sales must be a non-negative number.";
cout << "Enter the quarterly sales for the Northeast division: ";
cin >> northeast;

}
cout << "Enter the quarterly sales for the Southeast division: ";
cin >> southeast;
while (southeast <=0)
{
cout << "Sales must be a non-negative number.";
cout << "Enter the quarterly sales for the Southeast division: ";
cin >> southeast;
}

cout << "Enter the quarterly sales for the Northwest division: ";
cin >> northwest;
while (northwest <=0)
{
cout << "Sales must be a non-negative number.";
cout << "Enter the quarterly sales for the Northwest division: ";
cin >> northwest;
}
cout << "Enter the quarterly sales for the Southwest division: ";
cin >> southwest;
while (southwest <=0)
{
cout << "Sales must be a non-negative number.";
cout << "Enter the quarterly sales for the Southwest division: ";
cin >> southwest;

}
return 0;
}
void find_Highest (double & northeast , double & southeast , double & southwest, double & northwest)

{

if ((northeast > southeast) & (northeast > northwest) & (northeast> southwest))

{
cout << "The highest earning division is NorthEast at: \$" << highestsales << endl;
highestsales = northeast;
//return northeast;
}
else if ((southeast > northeast) & (southeast > northwest) & (southeast > southwest))

{
cout << "The highest earning division is SouthEast at: \$" << highestsales << endl;
highestsales = southeast;
// return southeast;
}

else if ((northwest > northeast) & (northwest> southeast) & (northwest > southwest))
{
cout << "The highest earning division is NorthWest at: \$" << highestsales << endl;
highestsales = northwest;
//return northwest;

}

else if ((southwest> northeast) & (southwest > southeast) & (southwest > northwest))

{

cout << "The highest earning division is SouthWest at: \$" << highestsales << endl;
highestsales = southwest;
//return southwest;

}

}
for some reason it runs through and gets the right answer but wont display the correct value.
You display "highestsales" before computing it.
First, assign highestsales, then display it.
Topic archived. No new replies allowed.