// Castulo Jason Quintero CSC5 Chapter 5 homework, pg. 298 #22
//
/**************************************************************************
*
* Display Number of Squares
* _________________________________________________________________________
* This program will accept user input for a number no greater than 15 and
* will display a square using the character 'X'
* _________________________________________________________________________
* INPUT
* num : Number Inputed by User
* OUTPUT
* num_Square : Number of Squares
*
**************************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
const int MIN_NUM = 0, // CONST - Lowest Number
MAX_NUM = 15; // CONST - Highest Number
int num; // INPUT - Number Inputed By User
char num_Square = 'X'; // OUTPUT - Number of Squares
//
// Ask for Numbers Between 1 and 15
cout << "Enter a positive integer no greater than 15\n";
cout << "Enter Value Here: ";
cin >> num;
cout << endl;
//
// Display Number of Squares as X
if (num >= MIN_NUM && num <= MAX_NUM)
{
for (int i = 0; i < num; i++)
{
cout << num_Square;
for (int x = 0; x < num; x++)
{
cout << num_Square;
}
cout << endl;
}
}
//
// Validatng User Input
else
{
cout << "\n\nEnter Values that are between 1 and 15.";
}
return 0;
}