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.