TotalCharges are not correct. |
Can you be more specific about what is not correct.
What inputs are you supplying?
What outputs are you getting?
What outputs are you expecting?
Your code looks better, although it still has some problems. All of which I have mentioned before.
- Your assignment states you must use function calls. You have no function calls in your program. I gave you an example function (get_int) that you can use to gracefully accept only valid hours and minutes.
Lines 14-16,20-22: These should be
const
.
Line 52: If the user enters an invalid character, you terminate the program. It would be better to have a loop that prompt the user to reenter the value until a valid value is entered.
Line 67-69: You use HourIn,HourOut,MinIn,MinOut before you've checked that they're valid.
Lines 71-75: If any of the values are invalid, you exit the program. Again, a loop to reprompt the user until they've entered valid values is appropriate here. Or use the get_int() function I provided previously.
Line 74: Your return value makes no sense. Why are you returning a boolean OR of these values?
Line 107: Your cout should be vehicleText.