a)i got stuck with a qustion which asks for a date input in this format:

DD-MM-YYYY. I used a string to get the date input because the "-" are required, but then i'm not sure how to check that the user only enters dates.

b)another problem i encountered is that the code asks for a numerical input, like a catalogue for books, in the format YYYYNNN, where YYYY is the year which the input is made, and NNN is a unique number to identify the book. For example, if a book is entered into the catalogue in 2007, its catalogue number would be 2007123. The numerical inputs(catalogue number) cannot overlap, i.e., if there is already a 2007234, there cannot be another 2007234, but a 2006234 can still be entered. I'm unsure of how to validate this catalugue number input.

Any help would be greatly appreciated, thanks!