ahouts / CIS22B_FinalProject

\ Final project for CIS22B
0 stars 3 forks source link

Input checks for cashier.cpp #108

Closed scrable closed 8 years ago

scrable commented 8 years ago

Added check for char in addBookMenu().

Added option to exit from entering an identifier to cart. Previously you would get stuck in the menu with no way to get back to the main menu other than closing the program. This is currently set to 0 but it can be changed to any value you guys want. It's all I could think of since the program already tracks -1 for no ID found. I don't believe 0 is ever used as an identifier since the default constructor sets it to 1. Change it if I'm wrong please!

Added a check to make sure something is in cart before proceeding to checkout.

Changed some output text

ahouts commented 8 years ago

In that case you could actually use anything <= 0 because it would prevent invalid answers. -1 is the bookIdentifier of books that don't exist in the database, and is given if they search for an identifier that is not found in the database.

scrable commented 8 years ago

Ahh I see what you mean, I'll change that real quick.

ahouts commented 8 years ago

Wait if you say 0, because it says use 0 to exit, now it will say "A book with identifier 0 was not found." instead of "Exiting..." or something. lol too many conditions to keep track of.

scrable commented 8 years ago

I'll just edit the text and it won't matter anymore. If we keep it like this and I remove the "enter 0 to exit" thing it will just prompt the user to press enter to return to the main menu after either an invalid ID or not found.

ahouts commented 8 years ago

Sounds good. :+1:

scrable commented 8 years ago

Whoops forgot to uncheck the database file. Let me get rid of that real quick.

ahouts commented 8 years ago

;)

scrable commented 8 years ago

I always forget about this thing...

ahouts commented 8 years ago

Looks good. Merging now.

scrable commented 8 years ago

I still have to check a few other portions for valid inputs. Is there anything else we need to do?