Looking at your entered values, the output must be 20. So what was the output you got, and specify the if statements you are talking of.
Edit: @line 41, there must be an else before
|quantityOfItem = quantity ;|
Last edited on
My output is:
The quantity entered is invalid,so 0 is stroed as a default value
The price entered is invalid,so 0 is stored as a default value
The invoice amount is: 20
I don't understand why those first two line are printed???
NB:I know I could use "else" but according to the book am studying,.am supposed to use "if"
Your code works fine for me.
Can you post your Invoice.h file?
Dont see any problem with the code.