Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(use python) B ACKGROUND : A Restaurant Supply Store called Buy-Fresh sells different restaurants items (such as vegetables, fruit, beverages and restaurant equipment). Customers (restaurants

(use python)

BACKGROUND:

A Restaurant Supply Store called Buy-Fresh sells different restaurants items (such as vegetables, fruit, beverages and restaurant equipment). Customers (restaurants owners) visit this store daily to buy their restaurants needs. Your mission is to write a python program that handles customers sales and reports to the owner the end of day sales.

SPECIFICATIONS:

Every day different number of customers visit the store. Your program should handle this situation and work regardless of the number of customers. Therefore, you should think about a way to indicate that there are no more customers to serve. One of the suggested ways is to let the program asks the user for a customer ID, if the user gives -1, then that means you have no more customers. Otherwise, perform the operations below. This is very similar to the idea to one of the problem used in lab 3.

Now, if there is a customer standing in a line, then the program asks the customer to enter/input/provide data for four different categories (vegetables, fruits, Beverages and restaurant equipment) as follow.

? Enter the total weights of the fruit in pound.

o Input validation:

? The program does not accept negative weight or weight more than 200 pounds. In such case, let the program show an error message and ask the user again to enter a number between 0 and the maximum repeatedly until a valid number is entered.

o Once the user provides the correct fruits weight, then your program calculates the cost of that amount. The price per pound here is $1.73

? Enter the total weight of the vegetables in pounds

o Input validation:

? The program does not accept negative weight, or weight more than 300 pounds. In such case, let the program show an error message and ask the user to enter a number between 0 and the maximum repeatedly until a valid number is entered.

o Once the user provides the correct vegetables weight, then your program calculates the cost of that amount as follow:

? For weight less than 50 pounds, the price is $1.59.

? The weight more than 50 and less than 150, the price per pound is $1.39.

? For weight more than 150, the price per pound is $1.19.

? Enter the number of beverages as of bulk packs.

o The program does not accept negative number, or number more than 250 bulks. In such case, let the program shows an error message and ask the user to enter a number between 0 and the maximum repeatedly until a valid number is entered.

o Once the user provides the correct number, then your program calculates the cost of that amount as follow:

? If the customer gets more than 200 bulks, then give him 5 bulks free out of these 5 bulks with single cost of $1.79.

? Otherwise, a single bulk cost is $1.99.

? Enter the amount in dollars for the restaurant equipment.

o The program does not accept negative number. In such case, let the program shows an error message and ask the user to enter a number between 0 and the maximum repeatedly until a valid number is entered.

o Once the user provides the correct number, then your program calculates the cost of that amount as follow:

? If the customer gets equipment that worth more than $3000, then give him a 15% discount.

? You should save all the data inputted from the user, their costs and their discounts (if possible) into 3 different lists. You need to use these 3 lists to prepare the store end of day sales report. Make sure to initialize these lists before your loop.

Now once a customer gives all his data (sales/4 categories) and perform all the calculation above. The program prints a receipt for the customer in the following format:

o Print the customer ID.

o For every category print its name and its original cost in one line.

? All the amounts should be printed with two digits past the decimal point.

o After that print the discount given (if possible).

? All the amounts should be printed with two digits past the decimal point.

o Show the final sub-total cost.

o Calculate and add 6% to the customer order.

o Show the final cost to the customer.

o Give/ask the customer the option to pay by credit or by cash.

? If the customer chose by credit, then ask only for the credit type (Visa/Master/Discover/American Express).

? But, if the customer chose by cash, then let him enter the amount of payment and calculate the exchange left (if the customer pays more than the required amount)

o Follow the format of the output as shown in the sample run (provided later).

The program should then repeat this process (starting from asking about the four categories until the last step above) for the next customer until no more customer is there (the ID is -1).

Once all customers data have been entered processed and their individual receipts printed for all customers, the program should print an overall end of day sale that includes the following.

- The total number of customers came to the store that day.

- The total amounts (in pounds) for the all the fruit sold that day.

- The total sales amount in dollars for the all the fruit sold that day.

- The total amounts (in pounds) for the all the vegetables sold that day.

- The total sales amount in dollars for the all the vegetables sold that day.

- The total amounts (in bulks) for the all the beverages sold that day.

- The total sales amount in dollars for the all the beverages sold that day.

- The total sales amount in dollars for the all the restaurants equipment sold that day.

- The total sales of all the categories.

- The total discount of all the categories.

- The total amount in dollars for all the sales that day (after discounts).

- Top/Max sale out of the four categories.

Sample run

image text in transcribed

Welcome to BuyFresh Enter the customer ID (-1 to Exit): 100 Enter the total weights of the fruit (in pound)between 0 and 200: 20 Enter the total weights of the vegetables (in pound)between O and 300: 30 Enter the number of beverages as of bulk packs between 0 and 250:40 Enter the amount in dollars for the restaurant equipment: 1000 Customer ID : 100 Fruit (Pounds) :20.0 Regualr Price 34.6 Discount Today's Price 34.6 Vegetables (Pounds) : 30.0 Regualr Price : 47.7 Discount Today's Price : 47.7 Beverages (Packs) 40.0 Regualr Price 79.6 Discount0 Today's Price 79.6 Regualr Price 1000.0 Today's Price 1000.0 Equipment (dollar) 1000.0 Discount0 Sub Total 1161.9 Tax69.71 Total1231.61 Enter the customer ID(-1 to Exit): 101 Enter the total weights of the fruit (in pound)between 0 and 200: -8 Invalid input, please input something between 0 and 200 Enter the total weights of the fruit (in pound)between 0 and 200: -5 Invalid input, please input something between 0 and 200 Enter the total weights of the fruit (in pound)between 0 and 200: 250 Invalid input, please input something between 0 and 200 Enter the total weights of the fruit (in pound)between 0 and 200: 360 Invalid input, please input something between 0 and 200

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

Students also viewed these Databases questions

Question

Differentiate the function. r(z) = 2-8 - 21/2 r'(z) =

Answered: 1 week ago