Question
Sands of Time(c++) Instructions: Write an application that reads an odd number in the range 1 to 29 then prints an hourglass shape. The number
Sands of Time(c++)
Instructions:
Write an application that reads an odd number in the range 1 to 29 then prints an hourglass shape. The number entered by the user denotes the height and width of the hourglass. You may use output statements that print a single asterisk (*), a single hash (#) a single space or a single newline character.
The program ends when the user enters -1.
Sample Program Run:
Enter hourglass height: 2 Invalid Input! Enter hourglass height: 30 Invalid Input! Enter hourglass height: 9 ######### #*******# # ***** # # *** # # * # # *** # # ***** # #*******# ######### Enter hourglass height: -1 Program Exiting. Thank you! |
NOTE: You are to maximize your use of iteration statements (with nested for statements), and minimize the number of output statements
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started