Question: Q1. Write a single program that uses loops to display Patterns A and B (see sample run below). Your first loop will display Pattern A,

Q1. Write a single program that uses loops to display Patterns A and B (see sample run below). Your first loop will display Pattern A, and then write a second loop to display Pattern B. Your program should prompt the user to enter the Height of the pattern. Your program should also include a loop that lets the user repeat the program until the user says he or she is done Input Validation for Height: Do not accept zero or a negative value for height. That is if the user; enters 0 or a negative number, your program should prompt the user to re-enter a positive number for the height. Sample Run. Text in red is user entered values Enter Height:!5 Printing Pattern A Printing Pattern B Do you wish to run the program again Enter y/Y to run or n/N to quit: y Enter Height: -8 Height has to be positive Enter Height: 8 Printing Pattern A Printing Pattern B Do you wish to run the program again Enter y/Y to run or n/N to quit: n Done
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
