Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, I need help for this python code. Thanks in advance recipes = { small: { ingredients: { bread: 2, ## slice ham: 4, ##

Hello, I need help for this python code. Thanks in advance

recipes = { "small": { "ingredients": { "bread": 2, ## slice "ham": 4, ## slice "cheese": 4, ## ounces }, "cost": 1.75, }, "medium": { "ingredients": { "bread": 4, ## slice "ham": 6, ## slice "cheese": 8, ## ounces }, "cost": 3.25, }, "large": { "ingredients": { "bread": 6, ## slice "ham": 8, ## slice "cheese": 12, ## ounces }, "cost": 5.5, } } resources = { "bread": 12, ## slice "ham": 18, ## slice "cheese": 24, ## ounces } ### Complete functions ### class SandwichMachine: def __init__(self, machine_resources): """Receives resources as input.  Hint: bind input variable to self variable"""  self.machine_resources = machine_resources def check_resources(self, ingredients): """Returns True when order can be made, False if ingredients are insufficient."""   def process_coins(self):  """Returns the total calculated from coins inserted.  Hint: include input() function here, e.g. input("how many quarters?: ")"""   def transaction_result(self, coins, cost):  """Return True when the payment is accepted, or False if money is insufficient.  Hint: use the output of process_coins() function for cost input"""   def make_sandwich(self, sandwich_size, order_ingredients): """Deduct the required ingredients from the resources.  Hint: no output"""  ### Make an instance of SandwichMachine class and write the rest of the codes ###

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Learn Mysql The Easy Way A Beginner Friendly Guide

Authors: Kiet Huynh

1st Edition

B0CNY7143T, 979-8869761545

More Books

Students also viewed these Databases questions

Question

Factors Affecting Conflict

Answered: 1 week ago

Question

Describe the factors that lead to productive conflict

Answered: 1 week ago

Question

Understanding Conflict Conflict Triggers

Answered: 1 week ago