Jump to content

formatting

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
kumamako

kumamako

    Newbie

  • Members
  • PipPip
  • 16 posts
hello guys. I have finished my project and its working perfectly fine. however, my output is not aligned properly and needs some minor adjustment. I have played around with the setw function but i really do not know what is causing the problem. I mean, the output does not look very bad. i just feel it could be much better. anyways

1) i need to right justify the values on the far right colum(difference column).

2) i need to align the columns perfectly as they are not aligned. you could try putting in the values and you will see what i am talkin about.

i am attaching my file below. thank you

Attached Files



#2
chili5

chili5

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 7,247 posts
printf - C++ Reference

I have to pick on you for doing this:

using std::cout;
using std::cin;
using std::endl;
using std::fixed;
using std::right;
using std::left;

Why don't you just use this and save all the lines in your code?

using namespace std;


#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Actually, I like kumamako's way better, chilli.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#4
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
Doing it that way you would not have to import as much into the program you will not be using. It still looks funny tho :P

#5
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts

BlaineSch said:

Doing it that way you would not have to import as much into the program you will not be using. It still looks funny tho :P
I don't think using a namespace "imports" anything.

#6
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
^^ Exactly ;)
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa