Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

from site https://www.subway.com/en-ca/menunutrition/menu, i have made a python program for the user to choose a menu item from two different restaurants (2 total) and make

from site https://www.subway.com/en-ca/menunutrition/menu, i have made a python program for the user to choose a menu item from two different restaurants (2 total) and make an object for each of those items in the class you have defined. Please check for my coding and here are instructions: The program needs to have the nutrition information available to fill out the attributes. Each menu item will have an object with the following information: item name, restaurant name, calories, protein, and fiber. Also, each attribute can be recalled individually. These menu items need to have a defined class so new items will be created with the same attributes. For each menu item, there should be a command to output the menu item's name, restaurant, and total calories in proper sentences. For example: "The Egg and Bacon English Muffin from Subway contains 390 calories. After creating two objects manually, I have to make one more menu item object for a Spicy Chicken Sandwich from Wendy's using the spicy_chicken.txt data file. The spicy_chicken.txt reads:sc = {'item name' : 'Spicey Chicken Sandwich', 'restaurant name' : 'Wendys', 'calories' : 500, 'protein' : 28, 'fiber' : 3}

In addition, my program will also have to have the following functionality: A function that determines the percent of daily fiber for an object in the menu item class. The recommended daily fiber intake is 30 grams for an adult.

Class MenuItem:

def_init_(self, name, price, caloriies):

self.name = name

self.price = price

self.calories = carories

Example menu items:

item1 = MenuItem("Veggie Delite", 5.99, 230)

item2 = MenuItem("Oven Roasted Chicken", 6.99, 320)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

class MenuItem def initself name restaurant calories protein fiber selfname name selfrestaurant rest... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java Programming

Authors: Joyce Farrell

10th Edition

0357673425, 9780357673423

More Books

Students also viewed these Programming questions

Question

How much is 1/2 % of $10?

Answered: 1 week ago

Question

1301/2 % of $455 is what amount?

Answered: 1 week ago