You are working at a Rico’s, a new Mexican restaurant

profileThehonest
 (Not rated)
 (Not rated)
Chat

You are working at a Rico’s, a new Mexican restaurant. The restaurant must keep track of all food items and their prices on its menu. The restaurant manager has asked you to also figure out the average price of a menu item so she can compare it to other restaurants. To limit confusion, the restaurant manager will only permit up to 10 items on the menu at a given time. However, the manager might try expanding their menu in the future and may want to increase the number of food items contained on the menu. Create an object-oriented solution that allows the restaurant manager to enter up to 10 food items. An error message must display if the manager tries to enter more than 10 food items. Display a summary of all food items, the number of food items entered, and the average price of a food item on the menu.

 

Note: You must demonstrate use of an array of objects and JOptionPane.

 

Hint: Don’t forget about the different modifiers available (e.g. static) to determine what might be needed for each variable and method.

The example run below shows how the program would run. Note, user input is denoted in orange.

 

Example run

 

Enter the name for menu item 1:

Taco

Enter the price of Taco:

1.00

Enter another menu item?

Yes

Enter the name for menu item 2:

Enchilada

Enter the price of Enchilada:

A

Sorry, you entered an invalid menu item price. Please try again

Enter the price of Enchilada:

2.50

Enter another menu item?

Yes

Enter the name for menu item 3:

Burrito

Enter the price of Burrito:

2.00

Enter another menu item?

No

 

 

 

 

 

    • 10 years ago
    A+ Work
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      mexicanrestaurant.zip