0% found this document useful (0 votes)
6 views4 pages

Advancepython

Uploaded by

khushal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Advancepython

Uploaded by

khushal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Part I: Warehouse Application

A warehouse, which stores different products, has an operative, “John”, who registers the
product and prepares orders for dispatch. Each order could contain more than one product.
Each product has five attributes, including ID, name, available quantity, the last time it was
ordered, and the product specification, which can be a text that details the product. Each order
contains the name or IDs of the products that have been ordered. The warehouse can keep a
maximum of five quantities for each product. Once any product's quantity becomes zero, they
will buy five new quantities.
The Warehouse workflow: Once John receives the order, he should complete the following
tasks:
1- He registers the order
2- He collects the products in the order. If a product is out of stock, he will put it on the
shopping list.
3- The shopping team will buy the products in the shopping list if needed.
4- The order is placed into the Collection queue.
5- A delivery team collects the order from the collection queue.
6- The order is removed from the collection queue.
Registering an order takes 1s. John can collect the products in each order in 1s maximum, and
the delivery team can collect an order once every 3s. The shopping list can be bought in 3s.
Sometimes, John needs to register orders while completing the other tasks.

PART I.1
Using Object-Oriented programming, create an application with GUI that can do the following
tasks:
1- It could add or remove products. When removing a product, if its quantity is zero, the
software should raise an error, for example, “Out of stock”, and display the error on
the GUI
2- Given a product name or ID, it could search for the product. If the product is not among
the products kept in the warehouse, it will print “No product with this name or ID”, if
the product exists but has zero quantity, it will print “Out of stock” .
3- It could display the product information, including their name and available quantities
if requested. The information should be displayed on the GUI .
4- It could give a report containing the names and quantities of the products in a PDF
format .
5- When entering a product, it could check the similarity between the product’s
specification and all product specifications in the warehouse and show the ID and name
of the product with the highest similarity on the GUI on the fly (See NOTE1 for a hint
on how to implement this) .
6- It could generate a shopping list in a PDF format containing the ID and name of the
products with zero quantities
7- It could add or remove an order which is a list of product IDs or names. It should
automatically assign an ID to new orders and print it on the GUI. New orders will
initially be assigned a status “registered”. It should have options to change the orders’
status to “in the collection queue” and “collected”. Once the order has a status of
“collected”, it should be automatically removed. Details of all products in the order
also should be automatically updated
8- Once an order or product status is updated, it should be stored in a log file. The log file
for products should include the name and ID of the product which has been updated,
the product’s quantity, and the update’s date and time. The order log file should include
the order ID, time accepted, time collected, number of products ordered and their IDs,
and the update’s date and time. If any information is missing, it should be entered as
None
9- Create a clickable icon for the application. The application should run by clicking the
icon without the need to open a Python IDE

PART I.2- Concurrency, Parallelism and data structures


(a) Updating the application
In this part, you are asked to update the application created in PART I. 1 using the concurrency
and parallelism techniques and advanced data structures .You are expected to optimise
the program as much as possible. Your update
application should successfully deal with a hypothetical condition where multiple operatives
could use the application simultaneously.

(b) Simulating the warehouse workflow


Add a feature to your application to accept 30 orders in a JASON file and simulate the
warehouse workflow. Each order in the JASON file has an ID as its key and the products'
names as its value. Each order is itself a list of products’ names or IDs. You should use
concurrency, parallelism, and appropriate data structures. To simulate each task in the
workflow, you can write a method to wait for the task's duration and print a message on the
GUI upon task completion.
There are a few restrictions on the operations of the warehouse as follows:
• No order can be put in the collection queue until all products in the order are provided.
• The warehouse can store a maximum quantity of 5 for each product.
• Orders must be collected for delivery in order of their accepted time.
Once all orders from the input order list have been collected, your simulation should end. You
should create 30 random orders to test your simulation.
NOTE1: The similarity between products A and B is measured as the number of words in the
product A specification for which there is a word with a similar pattern in the product B
specification divided by the total number of words in the product A specification. To find words
with similar patterns, you can use regular expressions.
NOTE2: You do not need to create a database for the application Upon starting the program
or updating the product and order details, it could download them from or save them on the
hard disk.
NOTE3: Your GUI should have boxes to enter information
the minimum visual requirement

You might also like