I need assistance on starting writing my code, the direction states that the input will be taken from standard input, and so we need to define a book, the ISBN is 13 digit number. The title is a string of arbitrary length that ends with a line break.
B<ISBN><Title>
Ex. B 1231243556211 Title
I am fairly new to C++ and would like to get suggestion on how to start. Thanks!
Start it the same way you do with any other program. What do you think this program is going to need to do this job? How are your going to store the info you get? You are going to need variables for the for the different info. The ISBN is going to have to be able to hold 13 digits and I recommend using get line and to input the title as a string.
At 13 digits, a valid ISB number will be too large to store in many platforms' int.
I suggest using a string, or a wrapper class around a single string. It will require some extra validation, but you gain portability.
Alternatively, make sure you ask for an integer that is large enough. A 64-bit integer is the most common big-enough type: using isbn = std::uint_least64_t;