I have this beginning programing assignment and I'm really stuck...any help would be useful.
In the output that follows, a C++ program prompted a user for two inputs, the height and width of a box and the user responded with “32” for the height and “30” for the width. Write and compile the C++ program that did this:
Height of box: 32
Width of box: 30
* * * * * * * * * * * * * * *
** ** ** ** ** ** ** ** ** **
*** *** *** *** *** *** *** **
**** **** **** **** **** ****
***** ***** ***** ***** *****
****** ****** ****** ****** **
******* ******* ******* ******
******** ******** ******** ***
********* ********* *********
********** ********** ********
*********** *********** ******
************ ************ ****
************* ************* **
************** **************
*************** **************
**************** *************
***************** ************
****************** ***********
******************* **********
******************** *********
********************* ********
********************** *******
*********************** ******
************************ *****
************************* ****
************************** ***
*************************** **
**************************** *
*****************************
******************************
******************************
****************************** |
You must use two nested for-loops to solve this problem. You may not use any other loops to solve this problem.
You may not use arrays, chars or string variables.
You must only use cout statements that have only single character, for example, cout << "*";. Something like cout << "**"; or cout << " *"; is not permitted.
Spaces are counted as a character.
Your program must work for any height and width from 1 to 80 inclusive.
Hint Look closely at the pattern that the spaces form, and ... review the modulus operator “%”.