The task
In this task, you will design and implement a modular program to simulate a basic inventory management system for a small retail store. The program should allow users to perform various operations related to managing the store's inventory.
This program is designed to be running continuously (this means you'll need a loop that repeats until the user
types in exit.). The program should provide four options to the user, where they type a number to run
that part of the program:
- Add item to inventory
- Update the quanity of an item from it's ID
- Search for an item and display it's price and quantity. It should search for the item based on it's name, but should ignore case.
- Display a list of all item IDs and names in the format of id : name
- Display the item with the lowest quantity and the item with the highest price.
If the user types exit, the program will stop. Each item also has a unique ID (this is the number it is at in the arrays). When the user updates the quanity of an item, it will ask for this ID and then update the quantity using this ID.
The program should be prepopulated with at least 3 items when the program starts. Each item should have a name, price and initial quantity. You may choose what items the inventory contains.
Requirements
- Modular Design: Create a modular design for your program. Divide the program into meaningful modules, each responsible for a specific aspect of the inventory management system. Clearly outline the purpose and functionality of each module.
- User interface: Design a user-friendly text-based interface that enables users to interact with the program. The interface should provide options for the above options shown in The Task
- Data Structures: Implement appropriate data structures to store the inventory data. Each item in the inventory should have attributes such as name, price, and quantity.
-
Modular Implementation: Write separate functions for
each module in your design:
- add_item: Adds a new item to the inventory.
- update_quantity: Updates the quantity of a specific item.
- search_item: Searches for an item by name or description.
- display_inventory: Displays the current inventory to the user.
- find_lowest_quantity: Displays the item with the lowest quantity available
- find_highest_price: Displays the item with the highest price
- Input Validation: Implement input validation to ensure that users provide valid inputs for various operations. The program should handle incorrect inputs such as invalid item names, item prices or quantities gracefully.
- Documentation and Comments: Provide clear documentation for your program, explaining the purpose of each module and the functionality of individual functions. Include comments in your code to improve readability.
- Testing: Test your program with different scenarios to ensure that it works as intended.
- Report: Prepare a brief report summarising your approach to designing and implementing the modular program. Highlight the advantages of using modularity in programming and discuss how your modular design contributes to code organisation and maintainability. You can download a template for it here.
Submission
Submit the following items:
- A well-documented source code file containing your modular program implementation.
- A brief report about how you have developed the program to be modular and how that contributes to the code organisation.
How you are assessed
Your submission will be evaluated based on the following criteria:
- Clarity and effectiveness of the modular design.
- Correctness and functionality of the implemented program.
- User interface design and usability.
- Quality of code documentation and comments.
- Robustness of input validation and error handling.
- Creativity in tackling design and implementation challenges.
- Report containing the benefits of modularity in programming.
Notes
Plagiarism is strictly prohibited. Ensure that your submission is your original work.
Feel free to reach out if you have any questions or need clarifications during the task. Good luck!