Hello everyone, I'm trying to solve a problem in C++ using visual studio. The problem asks to write a program that asks the user for a positive integer no greater than 15, and that the program should then display a square on the screen using the character "X", and that the number entered by the user will be the length of each side of the square. It shows an example: when the user enters 5, the program should display:
XXXXX
XXXXX
XXXXX
XXXXX
XXXXX.
Here's what I have so far:
// This program will ask the user for a positive integer no greater than 15 and
will display a square on the screen using the character "X" with a length the
size of the number entered.
#include <iostream>
using namespace std;
int main ()
{
int number;
for (number=1;number<=15;number++)
cout << "{X}" <<endl;
system("pause");
return 0;
}
That's a rough guess on my part as to how to even go about this.. I'm not that experienced in this class I'm taking as I'd like to be, so any help will be appreciated. Tried asking the teacher and my teacher of course doesn't even reply after 3 days and counting >.<