GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 14-Aug-2007, 14:45
Emmy Emmy is offline
New Member
 
Join Date: Aug 2007
Posts: 4
Emmy is on a distinguished road

Need help printing "Hello" 7 characters high and 5 characters wide


Hi,
I just started learning C++ and I might be needing a lot of help so I decided to join this forum. The first problem am having is to try to print "HELLO" in big block letters where each letter is 7 characters high and 5 characters wide.

I will greatly appreciate any help and I also need a mentor to help me in C++, whom I can send emails to when I have problems in programming.

The code I have to print "Hello" is

#include <iostream>
using namespace std;

int main() {
cout << "Hello";

cin.get();
return 0;
}

P.S
Please ignore previous thread.
  #2  
Old 14-Aug-2007, 14:57
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,217
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Need help printing "Hello" 7 characters high and 5 characters wide


Quote:
Originally Posted by Emmy
...just started learning C++...print...big block letters ...
As a general program to print out any message, this does not seem to be a particularly appropriate first assignment, since I think it involves nested loops and 2-D arrays and things like that. It's a far cry (well, maybe not that far, but far enough) from cout << "Hello".

Unless, of course you just want to print a message "hard-coded" into the program. See footnote.

So, what is the actual assignment?

Regards,

Dave

Footnote: If it's OK to hard-code the message into the program, then open a text editor and manually build up the message. For example, I might want the message to look like the following:
Code:
H H EEEEE L L OOO H H E L L O O HHHHH EEE L L O O H H E L L O O H H EEEEE LLLLL LLLLL OOO

Each character is 5x7, and there are two blank columns between characters. Now if this is what you want, then just put a

cout << /* something goes here */ << endl;

statement for each of the seven lines of the message.
  #3  
Old 14-Aug-2007, 21:20
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,335
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: Need help printing "Hello" 7 characters high and 5 characters wide


Quote:
Originally Posted by Emmy
P.S
Please ignore previous thread.
Can't. Saw it first. You should have posted any new information the ignore message there...
__________________

During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence?
  #4  
Old 15-Aug-2007, 03:27
aaroncohn's Avatar
aaroncohn aaroncohn is offline
Regular Member
 
Join Date: Feb 2004
Location: Bay Area, CA.
Posts: 564
aaroncohn is a jewel in the roughaaroncohn is a jewel in the roughaaroncohn is a jewel in the rough

Re: Need help printing "Hello" 7 characters high and 5 characters wide


Yeah dave, I think it is just a first assignment to get used to writing code. This is pretty easy, Emmy. All you should have to do is break the block letters into lines, and print the lines one at a time like dave's post shows.

For example:
CPP / C++ / C Code:
cout << " Y   Y  OO"  << endl; // it says "YO". 
cout << "  Y Y  O  O" << endl; // I'm aware it looks like crap.
cout << "   Y   O  O" << endl;
cout << "   Y    OO"  << endl;
__________________
-Aaron
  #5  
Old 15-Aug-2007, 08:28
Emmy Emmy is offline
New Member
 
Join Date: Aug 2007
Posts: 4
Emmy is on a distinguished road

Re: Need help printing "Hello" 7 characters high and 5 characters wide


Thanks guys, I think Dave is right. I got the assignment from a C++ book am using, I was thinking there might be some code that enlarges print statements. That answers my question. Once again thanks.
Emmy
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 10:47.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.