Question: Write a program that asks the user to enter an integer between 1 and 15. If the number entered is outside that range, your program

Write a program that asks the user to enter an integer between 1 and 15. If the number entered is outside that range, your program should print out an error message and re-prompt for another number. (This is an input validation loop.)

Once the user enters a number in the correct range, your program will print out four patterns of asterisks that look like the following. Note that the number provided by the user is equal to the height of the pattern.

See example on left side**

For the final pattern, ask the user for an odd number between 1 and 15. (Your program should use an input validation loop to restrict valid input from the user to odd numbers between 1 and 15.) If that number is 7, then the diagram appears as follows:

see eaxmple on right side****

Write a program that asks the user to enter an integer between

For the final pattern, ask the user for an odd number between 1 and 15. (Your program should use an input validation loop to restrict valid input from the user to odd numbers between 1 and 15.) If that number is 7, then the diagram appears as follows

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!