The compiler is being helpful here. It has spotted an error in the logic, where the function is supposed to return a value, but under certain circumstances, the function reaches the closing brace without having specified any value to be returned.
In the context here, a reasonable solution would be, if the user enters an unacceptable value, rather than exiting from the function, instead repeat the prompt message so the user knows what is expected, then get the input figure again. It might be necessary to do this more than once, so a while loop could be a good idea.
I don't want to distract too much by talking about too many different ideas at once. However at line 7 some global variables are declared,
|
double neSales, seSales, nwSales, swSales, sales;
|
and at line 74 onwards, those global variables are used within the function. But - that means that the function parameters
double neSale,double seSale,double nwSale,double swSale
are completely ignored. You should do one thing or the other. Either use global variables or pass parameters, but don't try to do both, it will only cause confusion.
My recommendation is to get rid of the global variables. Their use is often considered bad practice.