There is so many thing wrong with your program, you should start by fixing the warnings that should be generated by your code:
main.cpp||In function ‘int main()’:|
main.cpp|68|warning: comparing floating point with == or != is unsafe [-Wfloat-equal]|
main.cpp|79|warning: comparing floating point with == or != is unsafe [-Wfloat-equal]|
main.cpp|83|warning: comparing floating point with == or != is unsafe [-Wfloat-equal]|
main.cpp|87|warning: comparing floating point with == or != is unsafe [-Wfloat-equal]|
main.cpp|91|warning: comparing floating point with == or != is unsafe [-Wfloat-equal]|
main.cpp|95|warning: comparing floating point with == or != is unsafe [-Wfloat-equal]|
main.cpp|99|warning: comparing floating point with == or != is unsafe [-Wfloat-equal]|
main.cpp|103|warning: comparing floating point with == or != is unsafe [-Wfloat-equal]|
main.cpp|107|warning: comparing floating point with == or != is unsafe [-Wfloat-equal]|
main.cpp|53|warning: ‘item’ is used uninitialized in this function [-Wuninitialized]|
main.cpp|53|warning: ‘price’ is used uninitialized in this function [-Wuninitialized]|
main.cpp|55|warning: ‘total’ is used uninitialized in this function [-Wuninitialized]|
main.cpp|120|warning: ‘amtTendered’ may be used uninitialized in this function [-Wmaybe-uninitialized]|
By the way the major problems have nothing to do with your functions. The major problems are mostly in your main() function.
So your algorithm is that you select items (or add to cart) until you press 8. You count every item in the cart to get total price then you calculate tax, tip, totBill etc and output the result?
line 58,67: Do not use a double for item. Doubles are approximations. item should be an int.
Line 52: This line is useless. price is 0, item is 0. Adding the two together is still going to be 0.
You're doing calculations before you have any meaningful values. Besides, why are you adding price to item? They are two different things.
line 54,56,58,60: These lines are in the wrong place. These calculations need to be after line 109 when you have some meaningful input.
line 111: Function prototype doesn't belong here. Function prototypes belong after line 4, but you don;t even need it since your function is in front of main.
Line 33: Why are you passing amtTendered in as an argument? It's not used outside this function. It should be a local variable inside this function.
while ( item !=8)
{
// Display enter item until 8 is selected
cout << "Enter Menu Item: ";
cin >> item; cout << endl;
switch(item)
{
case 1 : total += 6.00; break;
case 2 : total += 4.50; break;
case 3 : total += 3.75; break;
case 4 : total += 5.50; break;
case 5 : total += 2.80; break;
case 6 : total += 1.00; break;
case 7 : total += 2.00; break;
}
}
Line 106: As stated before, a function prototype doesn't belong here.
Line 110: Why are you adding total to price? You have this backwards. You should be adding price to total. And, you should be doing this inside your while loop.