deleted
Printable View
deleted
What code have you written for it so far?
deleted
The first thing I'm going to do is save Paul the eventual trouble. ;) Have a look at these threads and see what the recurring issue is. I'm not sure if you are including more non-standard headers than just iostream.h, but someone else will let you know.
Something else that will be mentioned (by either Paul or CPUWizard :p) is getch() no doubt. Even though you may be learning, it is a bad habit to use it to stop the program from executing.
Edit: You say that it "kind of looks like this"... but in your code it is 40 wide by 22 high. Could you please show us how it is supposed to look exactly?
deleted
Your program gets to a point where x is 23 which is <= 40, but then y is set to x in the nested loop and since 23 > 22, the outer loop gets executed 17 more times unnecessarily. Is this what you intended? Can you please post an exact replica of how the image is supposed to look, so that people can offer you suggestions that are going to help? :thumb:
deleted
1) Others have already said the basics of what I would say.
2) Posts such as http://www.codeguru.com/forum/showth...34#post1797834 have no basis anywhere on the forums (and have been reported to the moderator4s)
3) Please go back ad RE-READ the FAQS, especially the one "Why we DONT do homework".
Try to work out the algorithm in pseudocode.
Look at the diagram.
you print x stars
you then print y dots.
you then print x stars. and then a newline.
now x increases
you print x stars
now y decreases
you print y dots.
you then print x stars and then a newline.
See the pattern.....?
draws the top half of the pattern. The bottom half is a mirror image of the top and so you should be able to do it easily.Code:for ( you_to_do; you_to_do; ++var )
{
print_x_stars;
for ( more4utodo; more4utodo; --var )
{
print_y_dots;
}
print_x_stars;
print_a_newline;
}
On another note, do not hijack other peoples threads in the way you did. Make your thread, with a descripive title, and wait for help which usually comes when you show some effort yourself.
*I deleted this Post*
Please remove your post. We do not give homework answers with code here.
Read the FAQ concerning homework here:
http://www.codeguru.com/forum/showthread.php?t=366302
Regards,
Paul McKenzie