Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, I have 3 problems which has to solved in Python Problem One The first problem you need to solve is the whether or not

Hi, I have 3 problems which has to solved in Python

Problem One

The first problem you need to solve is the whether or not the quantity requested by the user is a viable option when ordering chicken nuggets at McDonalds. Assume that you can purchase chicken nuggets in quantities of 6, 9, and 22. That means that there is no combination of options that will allow you to purchase 23 chicken nuggets. In terms of the Diophantine equation, you can think of it as 6a + 9b + 22c = n. To achieve this objective, there are four specific requirements. Start by asking the user how many chicken nuggets they would like to order. For each possible order quantity by box size identify which combinations equivalent to n (in other words, look for what values of a, b, and c in the Diophantine equation work). If the order is possible, print a statement to the console that states how many options are available and what these options are (a console output example is shown in Figure 2). If there are no combinations that work (such as an order of 23), let them know that they cannot order the requested quantity.

Problem Two

The second problem is built on the foundation of the first problem. For this problem, it has been determined that it is simply not enough to tell the user their requested size is not feasible. You need to determine the closest feasible value of n given the quantity ordered by the user. Let the user know that their requested quantity is not feasible, but let them know they have options, by providing the quantity by box size options for this alternative feasible quantity.

Problem Three

For the third problem, youre going to build on your previous work in this assignment. The cost per nugget by quantity varies. For this problem, you need to give the user the lowest cost option. Assume that the 6-piece option costs $3, the 9-piece costs $4, and the 22-piece costs $9. Instead of presenting all possible options, provide the least expensive option and the total cost, instead. When the user requests a quantity that is not feasible, let them know that their order quantity isnt feasible and present the least expensive option and total cost for the suggested alternative quantity. You can think of this as a second Diophantine equation. While you still need to identify the values that satisfy the quantity requirements of 6a + 9b + 22c = n, there is an How many chicken nuggets would you like to order? 52 For an order size of 52, choose from the following 2 option(s): {'Six_piece': 2, 'Nine_piece': 2, 'Twenty_two_piece': 1} {'Six_piece': 5, 'Nine_piece': 0, 'Twenty_two_piece': 1} Figure 2 Example of the Console Output of Problem 1 Note. This is an example of what the expected output may look like when you run the solution to the first problem in this assignment. The text is yellow reflects the output from the program. The text in white reflects the users input. additional constraint 3a + 4b + 9c = cost (where 3, 4, and 9 represent the costs associated with the 6, 9, and 22-piece options, respectively)

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

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions