473,382 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

NEED SOME HELP GUYS.... :(

Just to inform you guys that i have only like 2 weeks that i took my
first classes in c++, and my proffesor now is asking me to solve this
problem:
/// Using a function create a Win32 Console Application which outputs
asterisks (*)on the screen displaying your name like a matrix screen.
it has to be in a top down-design style. PLS HELP THIS AMATEUR
STUDENT. *_*
if you can help me just send the source code... even that i cant do
that i can fidure out that it should be simple.
thank you Joe
Jul 22 '05 #1
13 1574
Joe Black posted:
Just to inform you guys that i have only like 2 weeks that i took my
first classes in c++, and my proffesor now is asking me to solve this
problem:
/// Using a function create a Win32 Console Application which outputs
asterisks (*)on the screen displaying your name like a matrix screen.
it has to be in a top down-design style. PLS HELP THIS AMATEUR
STUDENT. *_*
if you can help me just send the source code... even that i cant do
that i can fidure out that it should be simple.
thank you Joe


Step 1:

Open Notepad, pick a monospace font and design your name.
Step 2:

Use standard output to output the string.

Google for "cout".
-JKop
Jul 22 '05 #2
"Joe Black" <pr**********@hotmail.com> wrote in message
news:f1**************************@posting.google.c om...
Just to inform you guys that i have only like 2 weeks that i took my
first classes in c++, and my proffesor now is asking me to solve this
problem:
/// Using a function create a Win32 Console Application which outputs
asterisks (*)on the screen displaying your name like a matrix screen.
it has to be in a top down-design style.
That seems to me a reasonable assignment after two weeks of
classes.
PLS HELP THIS AMATEUR
STUDENT. *_*
Of course we'll help you. What we will not do is do it for you.
Show us the code of your best attempt, and ask specific questions.
if you can help me just send the source code...
Sending you the code would help you not at all (it might help
you pass your course, if you didn't get caught cheating, that is).
It certainly would not help you learn. "Give a man a fish", and
all that.
even that i cant do
Did you even try? If so, show us the code. If not, try.
that i can fidure out that it should be simple.


It is relatively simple.

Hints: Don't try to do it all at once. Do a little at a time,
testing as you go. Don't add more until what you have works
correctly. E.g. first write something that outputs a series
of asterisks (any number of them). Then perhaps something
which outputs a series of asterisks with interspersed spaces
(again, use any number of asterisks or spaces, just to get a
feel for things.) Then try to do the output on more than one
line. Then do multiple lines of differing lengths. Then
multiple lines with differing numbers of asterisks, then with
the spaces at differnent locations on a line, then differing
numbers of spaces, etc. etc.

Walk before you run. Here's a simple skeleton program to
get you started:

#include <iostream>

void ast(unsigned int how_many)
{
for(unsigned int i = 0; i < how_many; ++i)
std::cout << '*';

std::cout << '\n';
}

int main()
{
ast(42);
ast(25);
return 0;
}

-Mike


Jul 22 '05 #3

"JKop" <NU**@NULL.NULL> wrote in message
news:Cv*******************@news.indigo.ie...
Joe Black posted:
Just to inform you guys that i have only like 2 weeks that i took my
first classes in c++, and my proffesor now is asking me to solve this
problem:
/// Using a function create a Win32 Console Application which outputs
asterisks (*)on the screen displaying your name like a matrix screen.
it has to be in a top down-design style. PLS HELP THIS AMATEUR
STUDENT. *_*
if you can help me just send the source code... even that i cant do
that i can fidure out that it should be simple.
thank you Joe


Step 1:

Open Notepad, pick a monospace font and design your name.
Step 2:

Use standard output to output the string.


I seriously doubt that is a solution which would be
accepted by the instructor. I'm fairly certain he's
looking for loops. But of course one should verify
that before proceeding.
-Mike
Jul 22 '05 #4

"Joe Black" <pr**********@hotmail.com> wrote in message
news:f1**************************@posting.google.c om...
Just to inform you guys that i have only like 2 weeks that i took my
first classes in c++, and my proffesor now is asking me to solve this
problem:
/// Using a function create a Win32 Console Application which outputs
asterisks (*)on the screen displaying your name like a matrix screen.
it has to be in a top down-design style. PLS HELP THIS AMATEUR
STUDENT. *_*
if you can help me just send the source code... even that i cant do
that i can fidure out that it should be simple.
thank you Joe


Normally I don't help with homework whenthe poster has made no attempt
themselves. But this is so easy that I figure its not going to do you any
harm to give you the solution.

#include <iostream>

int main()
{
std::cout << "***** *** *****\n";
std::cout << " * * * *\n";
std::cout << " * * * ****\n";
std::cout << " * * * *\n";
std::cout << "** *** *****\n";
}

(best viewed using a fixed width font).

Good luck on the rest of your course, it is going to get a lot more
difficult than this.

john
Jul 22 '05 #5
"Joe Black" writes:
Just to inform you guys that i have only like 2 weeks that i took my
first classes in c++, and my proffesor now is asking me to solve this
problem:
/// Using a function create a Win32 Console Application which outputs
asterisks (*)on the screen displaying your name like a matrix screen.
it has to be in a top down-design style. PLS HELP THIS AMATEUR
STUDENT. *_*
if you can help me just send the source code... even that i cant do
that i can fidure out that it should be simple.
thank you Joe


I wouldn't classify any of the help or solutions I have seen posted as
meeting the top down stipulation. I think he wants something with more
potential to be an actual program that has the potential,at least, to be
used by someone who wasn't named Joe. It is possible, of course, that there
are responses I haven't seen.

Early dot matrix printers used a 5 x7 matrix. I doubt very much if there is
any automated way to produce the 52 latin letters. But you could write a
program that handles Joe so far, and has the potential for other names as
well. Get a piece of graph paper and start doodling in a 5 x 7 array. You
will see several strokes that are widely used. Five asterisks in a
horizontal row, for example, on the E, F, L, Z, .... There are also short
bars, *perhaps* rounded corners, slanted bars, (K and R) And so on. A
switch statement *might be* useful, I don't really know, I haven't thought
about it that much.


Jul 22 '05 #6
* osmium:

Early dot matrix printers used a 5 x7 matrix. I doubt very much if there is
any automated way to produce the 52 latin letters.
Aah, you forgot: to Peek the ROM!

Oops, that was Basic, 1970's (I used that technique to present somewhat
derogatory comments about the principal of our high school, it was very
clever because I accessed the lowercase letters in spite of the keyboard
only producing uppercase).

But I'm fairly certain that 5*7 character data must be on the net somewhere,
if only for ASCII art.

But you could write a
program that handles Joe so far, and has the potential for other names as
well. Get a piece of graph paper and start doodling in a 5 x 7 array. You
will see several strokes that are widely used. Five asterisks in a
horizontal row, for example, on the E, F, L, Z, .... There are also short
bars, *perhaps* rounded corners, slanted bars, (K and R) And so on. A
switch statement *might be* useful, I don't really know, I haven't thought
about it that much.


Arrays.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 22 '05 #7
Hi,

"Joe Black" <pr**********@hotmail.com> wrote in message
news:f1**************************@posting.google.c om...
Just to inform you guys that i have only like 2 weeks that i took my
first classes in c++, and my proffesor now is asking me to solve this
problem:
/// Using a function create a Win32 Console Application which outputs
asterisks (*)on the screen displaying your name like a matrix screen.
it has to be in a top down-design style. PLS HELP THIS AMATEUR
STUDENT. *_*
if you can help me just send the source code... even that i cant do
that i can fidure out that it should be simple.
thank you Joe


Hi,

Some pointers and ideas.

Look into
-CreateDIBSection
-TextOut
-CreateFont

etc.

Write something to the bitmap
Then read the bits that make up the bitmap and output a star to the console
if a bit is set..

Look on microsoft MSDN or the compilers help pages for a description of the
various functions.

Well the rest is up to you.

Regards, Ron AF Greve.
Jul 22 '05 #8
John Harrison posted:

"Joe Black" <pr**********@hotmail.com> wrote in message
news:f1**************************@posting.google.c om...
Just to inform you guys that i have only like 2 weeks that i took my
first classes in c++, and my proffesor now is asking me to solve this
problem: /// Using a function create a Win32 Console Application which
outputs asterisks (*)on the screen displaying your name like a matrix
screen. it has to be in a top down-design style. PLS HELP THIS
AMATEUR STUDENT. *_*
if you can help me just send the source code... even that i cant do
that i can fidure out that it should be simple.
thank you Joe


Normally I don't help with homework whenthe poster has made no attempt
themselves. But this is so easy that I figure its not going to do you
any harm to give you the solution.

#include <iostream>

int main()
{
std::cout << "***** *** *****\n";
std::cout << " * * * *\n";
std::cout << " * * * ****\n";
std::cout << " * * * *\n";
std::cout << "** *** *****\n";
}

(best viewed using a fixed width font).

Good luck on the rest of your course, it is going to get a lot more
difficult than this.

john


Why the multiple calls to cout?

#include <iostream>

int main()

std::cout <<

"***** *** *****\n"
" * * * *\n"
" * * * ****\n"
" * * * *\n"
"** *** *****\n";
}
-JKop
Jul 22 '05 #9
JKop wrote:
John Harrison posted:

#include <iostream>

int main()
{
std::cout << "***** *** *****\n";
std::cout << " * * * *\n";
std::cout << " * * * ****\n";
std::cout << " * * * *\n";
std::cout << "** *** *****\n";
}


#include <iostream>

int main()

std::cout <<

"***** *** *****\n"
" * * * *\n"
" * * * ****\n"
" * * * *\n"
"** *** *****\n";
}


[newbie here]

Shouldn't you both

std::cout << std::endl;

to flush the 'cout' stream?

Or the final '\n' does it on its own?
Or it really isn't needed? (I think I read somewhere it *IS* needed)

--
================== My mail address is spam-trapped ==================
If my name is not in the "To:" line; or if you send a "Content-Type:"
different than "text/plain" (optionally followed by anything); or
if message size is greater than 10K -- your mail _will_be_ /dev/null'ed
Jul 22 '05 #10
Moonlit wrote:
Hi,

"Joe Black" <pr**********@hotmail.com> wrote in message
news:f1**************************@posting.google.c om...
Just to inform you guys that i have only like 2 weeks that i took my
first classes in c++, and my proffesor now is asking me to solve this
problem:
/// Using a function create a Win32 Console Application which outputs
asterisks (*)on the screen displaying your name like a matrix screen.
it has to be in a top down-design style. PLS HELP THIS AMATEUR
STUDENT. *_*
if you can help me just send the source code... even that i cant do
that i can fidure out that it should be simple.
thank you Joe

Hi,

Some pointers and ideas.

Look into
-CreateDIBSection
-TextOut
-CreateFont

etc.

Write something to the bitmap
Then read the bits that make up the bitmap and output a star to the console
if a bit is set..

Look on microsoft MSDN or the compilers help pages for a description of the
various functions.

Well the rest is up to you.

Regards, Ron AF Greve.


Your answer is *WRONG*. He said "Console App". And the Win32 API is OT
in this forum.
Jul 22 '05 #11

"Pedro Graca" <he****@hotpop.com> wrote in message
news:sl*******************@ID-203069.user.uni-berlin.de...
JKop wrote:
John Harrison posted: std::cout <<

"***** *** *****\n"
" * * * *\n"
" * * * ****\n"
" * * * *\n"
"** *** *****\n";
}
[newbie here]

Shouldn't you both

std::cout << std::endl;

to flush the 'cout' stream?


Only if you need to ensure previous output appears
before subsequent output. Not applicable here, but
also note that performing input with 'cin' after
output with 'cout' will cause 'cout' to be flushed
before the input.

Or the final '\n' does it on its own?
Yes, since the scope (of main()) will be exited, invoking
'cout's destructor, which will cause a flush.
Or it really isn't needed? (I think I read somewhere it *IS* needed)


See above.

-Mike
Jul 22 '05 #12
Joe Black wrote:
Just to inform you guys that i have only like 2 weeks that i took my
first classes in c++, and my proffesor now is asking me to solve this
problem:
/// Using a function create a Win32 Console Application which outputs
asterisks (*)on the screen displaying your name like a matrix screen.
it has to be in a top down-design style. PLS HELP THIS AMATEUR
STUDENT. *_*
if you can help me just send the source code... even that i cant do
that i can fidure out that it should be simple.
thank you Joe


This will be for 5 x 7 fonts, but can be applied to
3 x 5 or any other size.

The easiest method is to have a 5 x 7 matrix (array or vector of
vectors) to contain the character pattern:
0 1 2 3 4
0 * * * * *
1 *
2 *
3 *
4 *
5 *
6 *

Let us call each one a cell. If you use constant C style strings,
you data structure would look like:
char t_cell[CELL_HEIGHT][CELL_WIDTH + 1];
The "+1" is to account for the terminating null character.

Let us define a font as a collection, or aggregate of cells.
Generally, there is one cell for each printable character in
the font. A simple method is to make this an array, which
would be a 3 dimensional array:
char font[NUM_OF_CHARS][CELL_HEIGHT][CELL_WIDTH + 1];

Note: I suggested arrays because the font is composed of
constant data. This method requires no extra effort to copy
the data into a dynamic structure such as a vector, list
or map.

To print out a row of characters, use the expression:
font[character - start_char][row_index];
where "character" is the current character being processed
"start_char" is the first character in the font.

So the loop is to print each row of the font for each character:
for each row do:
print font['T' - 'A'][row]
print inter-character-spacing
print font['O' - 'A'][row]
print inter-character-spacing
print font['M' - 'A'][row]
print newline.
end-for

This is the basic algorithm. Further optimizations and
data content are left for the reader.
--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library

Jul 22 '05 #13
Mike Wahler wrote:

"Pedro Graca" <he****@hotpop.com> wrote in message
news:sl*******************@ID-203069.user.uni-berlin.de...
[edited]
Or [std::cout << std::endl; at the end of main()] really isn't
needed? (I think I read somewhere it *IS* needed)


I must have misinterpreted what I read.

[edited] [It isn't needed], since the scope (of main()) will be exited,
invoking 'cout's destructor, which will cause a flush.


Ah! :)

Thank you for your explanations Mike, I really appreciate it.

Jul 22 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Snake | last post by:
Hi guys, I have question about classes. when u create class called Test. and you define variable Test c; so does this act like( a variable c of type Test pointing to an abject )? The thing that...
8
by: Tim Geiges | last post by:
Since I am being challenged with learning c# I figured I could pass some of the pain on to you guys :-) I have another question(this one is important for me to fix before I can get my app to Beta)...
3
by: Lucky | last post by:
hi guys, i'm practising regular expression. i've got one string and i want it to split in groups. i was trying to make one regular expression but i didn't successed. please help me guys. i'm...
0
by: Michael L | last post by:
Hi Guys(I apologize for the lengty post - Im trying to explain it as best i can) I've been cracking my head on this one for the past 24+ hours and i have tried creating the function in ten...
28
by: Gaby | last post by:
Hi guys, I have this ASP code that is a little long to post so but you can download it off of http://whatthedeuce.net/Form.asp I cant find out what my error is. I know it is not in my Access...
0
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need ...
8
by: Lucky | last post by:
hi guys! back again with another query. the problem is like this. i want to print a line like this: "---------------------------------------------" the easiest way is to simply assign it to...
6
by: Scotty Montague | last post by:
hi guys! i own 2005 ford mustang convertible and i want to make it go faster. my friend barry's told me that i can reprogram computer in my car and boost the horses. i assume computer program is...
1
by: skygenn | last post by:
hi guys im new at c++ program and im 1st year taking up I.T our prof in c++ gave us an assignments but she didnt even explain us how to begin doing it? honestly i have no idea how to begin it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.