Objectives
- Learn to initialize and iterate through multi-dimensional arrays
displayMenu and displayCategory. These methods are responsible for displaying the entire menu and specific categories of the menu, respectively.menu 2D array is an array of String, where each sub-array represents a category of the menu. The first element of each sub-array is the name of the category.menu[0][0] contains "Appetizers", menu[1][0] contains "Entrees" and menu[2][0] contains "Desserts".menu[1][1] is "Steak", menu[1][2] is "Stir-Fry" and menu[1][3] is "Porkchops".menu 2D array: Appetizers menu[0][0]
|
Deviled Eggs menu[1][1]
|
Nachos menu[1][2]
|
Salad menu[1][3]
|
Entrees menu[1][0]
|
Steak menu[2][1]
|
Stir-Fry menu[2][2]
|
Porkchops menu[2][3]
|
Dessert menu[2][1]
|
Key-Lime Pie menu[3][1]
|
Raspberry Tarts menu[3][2]
|
Sundae menu[3][3]
|
displayMenu method.menu array and print all their categories along with their respective dishes.displayCategory method.menu 2D array and an integer category, which represents the index of the category to be displayed (0 for Appetizers, 1 for Entrees, 2 for Desserts).displayCategory will display the chosen category and its dishes in the same format similar to displayMenu, but only for the specified category.-- Menu --
Category: Appetizers
Deviled Eggs
Nachos
Salad
Category: Entrees
Steak
Stir-Fry
Porkchops
Category: Desserts
Key-Lime Pie
Raspberry Tarts
Sundae
TEST: Printing entrees...
Category: Entrees
Steak
Stir-Fry
Porkchops