New Student needs some help

I am trying to write a program that displays this message in the following code

I would like it to appear as the following but when I execute it it still displays jumbled. I'd like it to look neat. It's supposed to look like a box of stars around the type

Can anyone help me with my formatting please!


#include <iostream.h>

main()
{
cout << " **************************************"endl;
cout << " * Programming Assignment 1 *"endl;
cout << " * Computer Programming 1 *"endl;
cout << " * Author: James V *"endl;
cout << " * Due Date January 13 *"endl;
cout << " **************************************"endl;

char any_keystroke;
cin.ignore(200, '\n');
cout << "\n\n";
cout << "Program execution has ended normally.\n";
cout << "Press the enter key to exit.";
cin.get(any_keystroke);
return 0;

}
Last edited on
Presuming you are using a monospaced font, you could simply add spaces on the end of the text to make all the lines the same length.
My code is aligned DEV C++ but the post here makes it all jumbled
Oh, I think I understand you. Put [code][/code] tags around your code.
I'm surprised this actually compiles.

At the end of your star box, you need to add << before endl.
pogrady thank you so much. I'm a newbie and that worked perfectly!
Topic archived. No new replies allowed.