Question: Select a design pattern that would help you solve it. Your answer should be just the name of the pattern. ONE WORD each. Although the
Select a design pattern that would help you solve it. Your answer should be just the name of the pattern. ONE WORD each. Although the problems are part of a larger context, you only need to model the described part of the problem. A menu consists of a set of choices and a mechanism for a user to specify which choice they want. There are a variety of styles of menus. One menu style is to print a number in front of each string (e.g., 1, 2, and so on) and the let the user enter a number to make a choice. Another menu style prints a letter in front of each string (e.g., A, B, and so on) and lets the user enter a letter to make a choice. Still another menu style prints each string out, and lets the user type in the first few characters of the string to make that choice. In general, all of the menus must provide a way to add entries to the menu, delete entries, display the menu, and obtain the user's choice. Note that each menu style requires slightly different information when it's created (the "numeric" style requires the starting number to use, such as 0 or 1; the "letter" style requires the starting letters, and whether the letters should be capitalized; and so on). We have two design constraints. First, although an individual application may have many different menus, they should all be in the same style (e.g., in a given application every menu should be "numeric" or it should use "letters", and so on). Second, a client using this framework should should be able to create menus, add entries, and so on, without ever being aware of the specific menus they are working with. Finally, it should be extremely easy for us to modify the program so that it uses a different menu style.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
