Question: SANDS OF TIME c++ ( NOT ALLOWED ARRAY AND STRING) Instructions: Write an application that reads an odd number in the range 1 to 29
SANDS OF TIME c++
(NOT ALLOWED ARRAY AND STRING)
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
Get step-by-step solutions from verified subject matter experts
