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

Write a function called drawSquare that has two parameters and a void return typ

ID: 3621210 • Letter: W

Question

Write a function called drawSquare that has two parameters and a void return type. The function's first parameter is an int value that specifies the dimension of the square (in asterisks) and the second parameter is an int value representing a boolean value that specifies if the square is hollow or not.A value of true (non-zero) means it is hollow and false (0) means it is filled (not hollow). You may assume only correct inputs are passed to your function. Your function must work for any size greater than or equal to 2 AND not output any black lines or spaces before or after the square itself. Here are some sample outputs of the function for various inputs:

Calling drawSquare(5, 1) would result in the following:
*****
*    *
*    *
*    *
*****

Calling drawSquare(3, 0) would result in the following:
***
***
***

Explanation / Answer

You should change the main function as per your requirement, the function has been made as per your requirements #include void drawSquare (int dim, int flag ) { if ( dim
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