Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Milestone 7: In this milestone, you will decompose your program into different functions. Each function will be responsible for a specific Python task, and you

Milestone 7:

In this milestone, you will decompose your program into different functions. Each function will be responsible for a specific Python task, and you will need to cover the different types of functions discussed earlier in the introduction.

Problem Description:

All the Red highlights correspond to a function you need to create.

Welcoming Message:

Your program should start by displaying the following welcoming message, and information about shop regulations:

"Welcome to our place!"

"We hope you like our lovely green sophisticated shop parlor!"

" Feel free to set up wherever you like, but please avoid playing loud music and don't bring your beverages because we have everything."

"If you want a delivery order, check out our mobile app : shope.app-store."

You need to figure out whether or not this function needs to take any input arguments or return any value.

Customer type menu:

After displaying the welcoming message, the following menu should be displayed:

normal

premium

The displaying of this menu should not occur inside the welcome function but rather in a different function. This function should prompt the user to enter a choice (1 or 2) and should return the users choice when calling that function.

Normal option:

The normal customer function takes an argument the number of items the customer wants to order and a number between 1 and 5 corresponding to the following menu that also should be displayed at the start of the function:

Bakery and Bread: 3MAD

Meat and Seafood: 120 MADs

Pasta and Rice: 5MAD

Soups and canned drinks: 10 MAD

Eggs: 1MAD

After displaying the menu, this The Normal function should return the total amount the customer should pay, using functions below: Bakery and Bread, Meat and Seafood function, Eggs function.

Bakery and Bread:

You need to write a function that does the following:

Took as argument the number of Bakery the customer wants to buy.

Computes the total price (3*number of items).

Returns the total price.

Other types of items:

For the other items create a function for each item, for Eggs the function Discount1 should be called.

Discount1 function:

This function is called only in the Egg item option, if the total is if the total is greater than 30, a discount of 10% is applied.

Premium option:

In the case of the premium option, the same menu as normal option should be displayed.

The user would have the chance to buy as many items as needed among the listed options. Whenever the user bought an item, they should be asked whether or not they want to buy another one.

Once the premium customer is done with buying stuff, the total amount to be paid is discounted using a function (Discount2 function) that would apply a discount according to the total amount. The function should take as arguments the total to be paid by the premium customer. If that total is greater than 2000, a discount of 20% is applied; if it is greater than 5000, a discount of 30% is applied; otherwise, no discount is applied. Then, the function should return the new total to be paid.

Note that the functions developed for each customer type can be used for both.

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_2

Step: 3

blur-text-image_3

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

The Operational Auditing Handbook Auditing Business And IT Processes

Authors: Andrew Chambers, Graham Rand

2nd Edition

0470744766, 978-0470744765

More Books

Students also viewed these Accounting questions

Question

Define procedural justice. How does that relate to unions?

Answered: 1 week ago