Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books