I need help with right justifying some text. What I want to do is output something like this:
What problem I'm having is that the code is not right justifying like how I want it to in this program. The numbers are variable as they are calculated based on input from the user.Code:One Two Three 1 $ 4.99 $ 3.98 2 $ 34.56 $ 905.30
I tried flagging cout as such:andCode:cout.setf(ios::adjustfield | ios::right);to try and get this output. Either way didn't work. I believe it works without the $ sign, but not with. Is there a way to get the desired output?Code:cout.setf(ios::right);
Edit: It does work without the $ sign, but the needs to be there as it is part of the output that the assignment calls for. Thanks.