Question: This program is written in the C++ programming language. I'm having trouble using only for loops for this program. I would love to see the

 This program is written in the C++ programming language. I'm having

This program is written in the C++ programming language. I'm having trouble using only for loops for this program. I would love to see the full program to see how everything works. Thank you very much!

write a program that prompts for a number of rows (nRows) from the user, and prints an hourglass of either nRows or nRows-1 rows. Your should only print hourglasses of 3 to 25 rows (to let the shape fit on a single screen), so force the user to enter a reasonable number of rows. Print different error messages if nRows is too big or too small. Then, if nRows is even, add one to get an odd number of rows. The first and last rows of the hourglass must abut the left margin. You may only print single character spaces or stars T. and newline An flush or endl. You may not M use any output manipulators, e.g., setw in this program. For example, if user enters 9 for number of rows, the hourglass will have g stars on the first line, 7on the second, 5 on the third, 3 on the fourth, then 1, 3, 5, 7,9 stars on the rest of the lines.You may use For Nested Loop sto print the shape itself. For example, you could have a nested For Loop structure that writes the top (inverted triangle of stars, then a second nested For- Loop structure that write the bottom triangle of stars.l don't want any if statements used. Do this all with For loops.You will have a fourth outer loop to force user entry to be reasonable. You MUST do the number-of-spaces and number-ofstars calculations for each row based ONLY on the total number of rows and the current row number. You MAY NOT use the previous line's number of spaces er stars for these caleulations. mple (with user entries shown in bold italic): of rows Enter That is to few rows for me to make an hourglass 30 Enter number of rows ourglass That is too many rows for me make an Enter number of rows 4 ce this becomes 5 rows

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!