Question: A program is required that prompts the user for a number between 1 and 20. The prompt should also tell the user enter 0 to

A program is required that prompts the user for a number between 1 and 20. The prompt should also tell the user enter 0 to end. The program will then print a series of asterisks to represent the number. If the user enters 0, the program stops. If the user enters anything larger than 20 or less than zero, an invalid input will be reported and the program waits for the next input. The asterisk should be printed using a loop. You can develop a function called prinrStar(n) that gets n and prints n asterisk. Sample run: Enter a number between 1 and 20. Enter 0 to end: 5 ***** Enter a number between 1 and 20. Enter 0 to end: 99 invalid input! Enter a number between 1 and 20. Enter 0 to end: 13 ************* Enter a number between 1 and 20. Enter 0 to end: 0 Thanks and bye
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
