Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python only, and please do not present advanced solutions, just the simplest. orders - Notepad File Edit Format View Help 12345; pinar organic milk;8.95 12345;

image text in transcribedimage text in transcribedpython only, and please do not present advanced solutions, just the simplest.image text in transcribed

orders - Notepad File Edit Format View Help 12345; pinar organic milk;8.95 12345; uno whole wheat bread;9.95 98734; broccoli;4.65 34567;dimes orange juice;6.50 98734; uno lavas; 8.25 12345; chicken wings; 18.95 98734;ground beef,61.95 34567; keskinoglu eggs;18.95 12345; Barilla Spaghetti;5.95 customers - Notepad File Edit Format View Help 89454, Kaan Kolay 12345, Anna Karpat 20987, Selina Roberts 98734, Mert Eren 45678, Alara Yetis Lab Objectives: Strings, Files, Modules Notes: You should only use functionality covered in CS115 in your solution. Your solution for this lab should not use lists, tuples, dictionaries. Do NOT use the string split() function. Include a docstring for your functions. 1. Download the files orders.txt, customers.txt. 2. Create a module, order.py that contains the following functions: a. find order(): takes a string file name and a customer name as parameters. Returns the order id of the customer with the given name. If no customer is found, returns -1. The customer name is not case sensitive. b. find order items(): takes a file name and an order id as parameters. Returns the total cost, and string set of items for the order with the given id. If the order id is not in the file, total cost will be zero and the (string) set of items will be an empty string. 3. Write a script, yourname_order_app.py that inputs the name of a customer from the user. Using functionality defined in the module, your program should display the items ordered by the customer and the total cost of the order. If customer/order is not found, display a meaningful message (see sample run below). Append the customer name and total cost to a file with the name order id>.txt. The program should keep inputting customer names and searching orders until the user inputs 'exit' to quit (not case sensitive). 4. Upload order.py and yourname_order_app.py in a zip file with the name: Lab04_yourname.zip. Sample Runs: Enter customer name to search (exit to quit): Anna Karpat Order Summary: pinar organic milk uno whole wheat bread chicken wings Barilla Spaghetti Total Order Price: 43.8 Enter customer name to search (exit to quit): Sara Glen Customer Not Found ! Enter customer name to search (exit to quit): Selina Roberts Order Not Found! Enter customer name to search (exit to quit): MERT EREN Order Summary: broccoli uno lavas ground beef Total Order Price: 74.85000000000001 Enter customer name to search (exit to quit): exit

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

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions

Question

9. System creates a large, diverse talent pool.

Answered: 1 week ago