Asked by Micheal
Hoe do I write a program to Create a C++ console application that uses cout to display a box of asterisks?
Answers
Answered by
MathMate
A box of asterisks is displayed line by line.
Try to draw a box of asterisks by hand to determine how you construct each line, i.e. how many asterisks followed by how many spaces, etc.
Each line drawn correspond to a cout command. Now study the C++ language to see how asterisks can be displayed using the cout command, and construct each command individually.
If you find duplications in the cout commands, you will have the opportunity to simplify your programme by looping structures (for, do...).
Try to write the program and if it does not compile, or if it does not give what you want, post your programme for further help.
Try to draw a box of asterisks by hand to determine how you construct each line, i.e. how many asterisks followed by how many spaces, etc.
Each line drawn correspond to a cout command. Now study the C++ language to see how asterisks can be displayed using the cout command, and construct each command individually.
If you find duplications in the cout commands, you will have the opportunity to simplify your programme by looping structures (for, do...).
Try to write the program and if it does not compile, or if it does not give what you want, post your programme for further help.
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.