So my prof wants us to to format our output in a table, i have everything but the actual output code.
Display the character for the ASCII codes 32 through 127, inclusive. Using a loop the output will result in a table format. Put the title ASCII Codes/Characters centered above the table.
The next line the table will be the column headings to identify the material in the table.
For each code value value in range given print both the code and the character for that code.
Make the printout readable with sets for 6 codes & the corresponding characters on each line printed
(that means 12 entries will be on each line). Use setw to space out each line in the table that is created.
Well I don't think I'm supposed to just give you the code... you're supposed to figure it out yourself.
Here are 3 problems (there are more) with the code you posted:
1. Your initial value for "letter" is 0, when it should be 32.
2. Your loop iterates a total of 128 times (0 to 127) when it should be 96 times.
3. Each line of the table is supposed to be 6 sets of 2, for 12 entries, not 12 sets of 1.
I currently have it outputting the numbers and symbols, but I can't seem to get the spacing right, and the top row keeps splitting in half and starting on the next row. It doesn't hurt to just point out something in a segment of code, I've helped people before. I fixed part of it.