Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that reads in the size of a square and thenprints a hollow squar

ID: 3616501 • Letter: W

Question

Write a program that reads in the size of a square and thenprints a hollow square of
that size out of asterisks and blanks. Your program should work forsquares of all sizes
between 1 and 20. If the input is greater than 20 or less than 1use 20 or 1, respectively.

For example, if the user enters 5, it shoud print

Sample Output:
      
Enter length of side:5
*****
*   *
*   *
*   *
*****

Enter length of side:10
**********
*        *
*        *
*        *
*        *
*        *
*        *
*        *
*        *
**********


Enter length of side:25
Invalid Input
Using default value 20
********************
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
********************


Write a program that reads in the size of a square and thenprints a hollow square of
that size out of asterisks and blanks. Your program should work forsquares of all sizes
between 1 and 20. If the input is greater than 20 or less than 1use 20 or 1, respectively.

For example, if the user enters 5, it shoud print

Sample Output:
      
Enter length of side:5
*****
*   *
*   *
*   *
*****

Enter length of side:10
**********
*        *
*        *
*        *
*        *
*        *
*        *
*        *
*        *
**********


Enter length of side:25
Invalid Input
Using default value 20
********************
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
*                 *
********************


Explanation / Answer

please rate - thanks #include using namespace std; int main() {int i,j,side; coutside; if(side
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote