I still can't line up vertical columns, code below, as one person suggested I use the space bar instead of tabs, I did that. I erased my code that looked just like this, but had used tabs to do it., then I rewrote it and aligned Unit and price, and Purchase and Date with the space bar. But the output is exactly the same as before. Is this really just trial and error trying to make a vertical column? there is no way to do it, like with placeholders (left align, right align, etc?? ) Since the output is aligning about 4 or 5 spaces to the left, do I just need to move it in my code 4 or 5 spaces to the right? So in the code it won't look right, but the program will? No way to make them both the same?
output for running program...
Item: Unit Purchase
Price Date
I just did it, but I had to keep playing with the spaces until the output looked right, is this the right way to program? This is what I had to leave it at to get the proper output..... crazy! okay, in the edit screen on here and while posting, my code looks as I intended. But I just looked at my post after posting it, and the code tags ruin the integrity of what I just posted, moving everything around. what a pain!! So below I will try again, the first one without code tags, and the 2nd with. Okay, now I see they both look the same on the finished post, with our without code tags. So I guess I cannot post my code the way I wrote it, there is no way to show you the spacing and alignment that I used. I can just say that it was a very unscientific approach, just trial and error on placement, until the output was correct below. Oh, I also see now that even my copy/paste from terminal doesn't look right!!!!!!! I can assure you that when I wrote it, it was aligned properly, and when I hit the post button it was perfect, but between posting and reading the post, MR somehow changes it and it doesn't stay as I wrote it!!! What a pain in the tooth!!!!
program output from terminal
Code:
printf ("Item: Unit Purchase\n" );
printf (" Price Date\n" ) ;
output for running program...
Item: Unit Purchase
Price Date
I just did it, but I had to keep playing with the spaces until the output looked right, is this the right way to program? This is what I had to leave it at to get the proper output..... crazy! okay, in the edit screen on here and while posting, my code looks as I intended. But I just looked at my post after posting it, and the code tags ruin the integrity of what I just posted, moving everything around. what a pain!! So below I will try again, the first one without code tags, and the 2nd with. Okay, now I see they both look the same on the finished post, with our without code tags. So I guess I cannot post my code the way I wrote it, there is no way to show you the spacing and alignment that I used. I can just say that it was a very unscientific approach, just trial and error on placement, until the output was correct below. Oh, I also see now that even my copy/paste from terminal doesn't look right!!!!!!! I can assure you that when I wrote it, it was aligned properly, and when I hit the post button it was perfect, but between posting and reading the post, MR somehow changes it and it doesn't stay as I wrote it!!! What a pain in the tooth!!!!
Code:
printf ("Item: Unit Purchase\n" );
printf (" Price Date\n" ) ;
printf ("Item: Unit Purchase\n" );
printf (" Price Date\n" ) ;
program output from terminal
Code:
Enter purchase date (mm/dd/yy): 11/09/10
Item: Unit Purchase
Price Date
Last edited by a moderator: