I've been trying to align a mini receipt I made for purchasing a book but am having trouble making it line up when I enter in details. Can you help me figure out how to align this information perfectly so no matter what the user enters, the title aligns with the title below, ISBN aligns with ISBN, quantity, etc. Thanks!
Usually when I do something like this I will put the headings inside a single pair of quotes and separate the headings with spaces then line 36 is where I use the "setw()"s testing and changing values as needed.
Back in the day when I was taking the class for Assembly, COBOL or for both we had a sheet of paper to work out the output. I do not have that available right now, but I was thinking a spread sheet could be adjusted for the same purpose.
As I recall the test I made with your program the output was close and just needed small adjustments.
I would suggest adding "setw(2)" before the quantity in case the quantity is ever a two digit number.