Problem description

Write a C++ program that can create four different patterns of different sizes. The size of each pattern is determined by the number of columns or rows. For example, a pattern of size 5 has 5 columns and 5 rows. Each pattern is made of character # and a digit, which shows the size. The size must be between 2 and 15. There should be a blank line before and after the pattern. The following table shows the four patterns in size 5: see image.

Notice you can only print a single digit, so for sizes greater than 9, you will print a hexadecimal digit, e.g. 10 = A, 11 = B, 12 = C, 13 = D, 14 = E, and 15 = F. Hint: While C++ defaults to printing integers in decimal (i.e. base 10), it can print integers in other numeric bases.

Your program displays a menu and asks the user to choose a pattern and size. But note that it must be robust: it must prompt the user to choose an option only between 1 and 5 and a pattern size only between 2 and 15. You are to print the menu and the users response. The following example shows all user menu responses, including potential errors (user responses are in bold):

---- M E N U ----
1. Pattern One
2. Pattern Two
3. Pattern Three
4. Pattern Four
5. Quit
Choose an option (between 1 and 5): 11
Incorrect option. Please try again.
Choose an option (between 1 and 5): 3
Choose a pattern size (between 2 and 15): 42
Incorrect pattern size. Please try again.
Choose a pattern size (between 2 and 15): 4

The program must consist of a main function and at least the following six functions (you may implement more to accommodate your design): get_option, get_size, pattern_one, pattern_two, pattern_three, and pattern_four.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.