2 beginner C++ problems

Sep 24, 2010 at 11:01pm
Okay I am a newcomer to C++ programming and have no experience in programming prior to this so I decided to take some college courses on programming. We are currently doing a project where we have to input values and the output is supposed to be in the form of a hotel bill. I have most of the program done but there are 2 things that would make my program run a bit smoother and I am not sure how to(assuming I can) do it.

The first problem I am having is underlining not just text but underlining the output of an entire line of code.

for example:

1
2
3
4
cout << "|" << setw(3) << "" << roomNumber << setw(4) << "|" 
    << setw(4) << "" << firstName << ' ' << lastName << setw(6) << "|" 
    << setw(6.5) << "" << roomRate << setw(7.5) << "|"
    << setw(5) << "" << numberNights << setw(5.5) << "|" << endl;


This is one example line in my overall code and I am wondering how i can underline the entire output of this.

My second problem is if there is any possible way to set line borders for the hotel bill so I do not have to make "|" into my vertical border and "_" or "-" into my horizontal border to separate the categories in my hotel bill.

I am sorry if my explanation is confusing, as I am unfamiliar with posting on forums and even though reading the How to Ask Questions post I am not sure if this is sufficient information. But any help at all would be great and I thank anyone for taking the time to help.
Sep 25, 2010 at 4:30am
As far as I know, there is no "formatting" of text if you're using the console. That means no italics, bold or underlining (though you can format number of digits in a number and other related things).

As well, I do believe you're stuck with | and _ as your borders.
Sep 27, 2010 at 2:01am
As well, I do believe you're stuck with | and _ as your borders.


If you can install NCurses library, you can have some limited "graphics" like border line etc but I still think it is not "beautiful" enough :)
Topic archived. No new replies allowed.