Calculate Total

n/a
Last edited on
Look at main() and only main(). You set the number and total of pizza, wings and bread to zero. Their values never change. 0 * anything = 0. You seem to be trying to calculate with these values before you have set them to anything.
n/a
Last edited on
The comment from abellia confused you somewhat, huh? ;)

Nono it's pefectly ok to initialze the variables. If you leave your ...Num variables 0 then the ...Total variables will be 0 as well (the same applies for unitialized).

So you have to ask the user how many pieces he want before you're calculating the result (...Total) and not after (like in displayResults()).
Topic archived. No new replies allowed.