#include <iostream>
#include <string>
using namespace std;
float input_div(string);
void findHighest(float, float, float, float);
int main()
{
float nE, sE, nW, sW;
nE = input_div( "North East" );
sE = input_div( "South East" );
nW = input_div( "North West" );
sW = input_div( "South West" );
findHighest(nE, sE, nW, sW); //prints the result also
return 0;
}
float input_div(string)
{
float entry;
cout << "Enter the sales for " << "North East" << " Division: ";
cin >> entry;
return entry;
}
void findHighest (float nE, float sE, float nW, float sW)
{
string highest, name;
highest = nE;
name = "North East";
if(sE > highest)
{
highest = sE;
name = "South East";
}
if(nW > highest)
{
highest = nW;
name = "North West";
}
if(sW > highest)
{
highest = sW;
name = "South West";
}
cout << "the highest is " << name << " with" << highest << "\n\n";
}
ALRITE. THIS IS MY PROGRAM. WHEN I RUN, I AM GETTING AN ERROR WHERE IT SAYS highest = NE; ANY IDEA FOLKS? THX FOR ALL DA HELP:)