Question: PLEASE PYTHON ONLY!!!!!! AND PLEASE DO NOT PRESENT ADVANCED SOLUTIONS!! THIS IS JUST AN INTRODUCTORY PYTHON COURSE Lab Objectives: Strings, Files, Modules Notes: You should

PLEASE PYTHON ONLY!!!!!!

AND PLEASE DO NOT PRESENT ADVANCED SOLUTIONS!! THIS IS JUST AN INTRODUCTORY PYTHON COURSE

PLEASE PYTHON ONLY!!!!!! AND PLEASE DO NOT PRESENT ADVANCED SOLUTIONS!! THIS ISJUST AN INTRODUCTORY PYTHON COURSE Lab Objectives: Strings, Files, Modules Notes: You

Lab Objectives: Strings, Files, Modules

Notes:

  • You should only use functionality in your solution.
  • Your solution for this 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:
    1. 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.
    2. 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 .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

orders (1) - Not Defteri Dosya Dzen Biim Grnm Yardm 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 (1) - Not Defteri Dosya Dzen Biim Grnm Yardm 89454, Kaan Kolay 12345, Anna Karpat 20987, Selina Roberts 98734, Mert Eren 45678, Alara Yetis orders (1) - Not Defteri Dosya Dzen Biim Grnm Yardm 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 (1) - Not Defteri Dosya Dzen Biim Grnm Yardm 89454, Kaan Kolay 12345, Anna Karpat 20987, Selina Roberts 98734, Mert Eren 45678, Alara Yetis

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To complete this task youll need to write two Python scripts orderpy and yournameorderapppy Heres a stepbystep guide on how to proceed 1 Create the or... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!