Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a LunchOrder application that prompts the user for the number of hamburge

ID: 3545373 • Letter: C

Question

Create a LunchOrder application that prompts the user for the number of hamburgers, salads, French fries, and sodas and then displays the total for the order.  The LunchOrder application should include a Food object with a constructor that accepts the price, fat, carbs, and fiber for an item.  Food method should return the price of the item and return the fat, carbohydrates, and fiber.  Use the chart below for food prices and nutrition information:

            Item                             Price           Fat(g)                   Carbs(g)           Fiber(g)
            Hamburger                 $1.85              9                           33                     1
            Salad                           $2.00              1                           11                     5
            French fries                 $1.30             11                          36                     4
            Soda                            $0.95              0                           38                     0


Application output should look similar to:

Enter number of hamburgers:   3
Each hamburger has 9.0g of fat, 33.0g of carbs, and 1.0g of fiber.

Enter number of salads:  4
Each salad has 1.0g of fat, 11.0g of carbs, and 5.0g of fiber.

Enter number of French fries:   2
French fries have 11.0g of fat, 36.0g of carbs, 4.0g of fiber.

Enter number of sodas:  5
Each soda has 0.0g of fat, 38.0g of carbs, 0.0g of fiber.

Your order comes to:  $20.90

Explanation / Answer

import java.util.Scanner;