Filters

Other

D

Your name is required for this document. It is only stored on this local computer and no where else. Please enter your name below:

NPA Software DevelopmentExploring Modularity in Programming

DGS badge
NPA Software DevelopmentExploring Modularity in Programming
The objective of this task is to understand and apply the concept of modularity in programming by designing and implementing a modular program to solve a specific problem. You may choose to use either Python or PHP to develop a solution to this problem.

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:

  1. Add item to inventory
  2. Update the quanity of an item from it's ID
  3. 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.
  4. Display a list of all item IDs and names in the format of id : name
  5. Display the item with the lowest quantity and the item with the highest price.
Main interface

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!

Provide Feedback

What did you think of this document?

!
-- DragonDocs version 0.9 --

20.08.2017

Started on DragonDocs
Created a YASS/PHP and HTML-based system for saving and retrieving data

21.08.2017
Added CSS styles to page
Added JavaScript code to the page

02.02.2018
Added the multipage option (used in my dissertation)
Added the XMLHttpRequest-based multipage requests

08.02.2018
Added the Accessibility features
Filters added

10.02.2018
Purple filter added

17.03.2018
Added the Note class
Added the Did You Know class

-- DragonDocs version 1.0 (Yosemite) --

02.10.2019
First trial of DragonDocs in teaching

04.10.2019
Added the Task, Starter, Review your learning sections

07.10.2019
Added the feedback feature
Added the Dark Mode toggle

19.09.2020
Performance gains through the removal of unnecessary code
Added the Learning Intentions and Success Criteria features
Added the school badge

31.09.2021
Changed the headings (h2) to be more consistent with my website
Added sections to the pages - sections must be preceded by a h2
Added the "I have read this section" buttons
Changed the main heading zone to gradient text like my website
Added the table of contents feature

02.02.2022
Added the Print feature
Updated the footer to feature a new gradient
Added the Test It! class
Added the green flag
Automated the table of contents using JavaScript

06.02.2022
Added the 'includes' feature to the document, allowing inclusion of other files easily
Removed the requirement that the IP address must be one of the schools I have taught at, opening these documents to the public

02.03.2022
Once a section has been read or completed, the user can now hide that section

10.10.2022
Added the Extension task class
Changed the scrollbar on Windows to match that of macOS

-- DragonDocs version 2.0 (Kilimanjaro) --

07.08.2023
Added the Save button and the ability to save 'results' or answers to a Word document

12.01.2024
Added the large numbers class
Removed the background of the page navigation

-- DragonDocs version 2.1 (Aurora) --

08.02.2024
Added the active class to active links in the bottom section

09.02.2024
Added the image upload feature

10.02.2024
Added a fix that prevents the upload of non-image files into an image upload
Added pasting images to the upload feature

11.02.2024
Added the ability to view the changelog from a document
Improved the feedback system by recording the DragonDocs User ID and the Document ID data
The feedback from DragonDocs can be accessed much easier

12.02.2024
Added the new step_by_step_mode feature, allowing sections to be viewed individually
Added the ability to lock and unlock DragonDocs

22.02.2024
Added new checkboxes to each list item in a .task or .step
Added functionality to said checkboxes to add a strikeout to steps completed

23.02.2024
Added the new 'step' class
Steps are now auto incremented in CSS so the name displays the step number
Activities are now also auto incremented to display the activity number

25.02.2024
Added the 'matcher' feature to DragonDocs
Fixed an issue in which a closed section would retain it's original height within the document navigation
Added starters and the lesson review to the navigation on the side
The learning intentions and success criteria in teaching documents have now been redesigned to match my slides design

26.02.2024
All buttons are now on the right hand side
The accessibility button now has WAI under it

-- DragonDocs version 2.2 (Serengeti) --

26.02.2024
Code has been rewritten from the ground up to be object-oriented, making additional features easier to add

28.08.2024
Changed the look of grouped multiple choice buttons

06.03.2024
Added the new dragondocs_name feature and the requires_name property which allows names to be prepended to saved documents

09.03.2024
Added code so when the user types in their name and hits the enter key it will save that data and close the modal window
Added the new DragonShow and DragonDocs Link - a connection between both services that allows the presenter to communicate with users of DragonDocs from a DragonShow
Added the new timer option which is sent from DragonShows

04.04.2024
The matcher feature is no longer embed from jamiebalfour.scot but actually a feature of DragonDocs
Made DragonDocs 100% object-oriented, meaning much better management and better performance

05.04.2024
Made subtle changes to the interface to tidy it up a bit

06.04.2024
The multiple choice questions are now also part of the object oriented interface

09.04.2024
As requested, h3 elements are now included in the 'floating navigation'
The active navigation element now becomes bold and the left border has been retired

05.06.2024
Saving files now exports as a PDF which now also embeds all fonts (removed now)

18.06.2024
Select dropdowns are now temporarily saved to local storage and are now recovered when the document is reopened

19.12.2024
Multipage navigation now switches pages seamlessly - it's beautiful

17.01.2025
Added support for multi-select storage and reloading

-- DragonDocs version 2.3 (Great Barrier) --

17.02.2025
Added support for reorder tasks
Added lines and attachment circles for matching tasks

19.02.2025
Improved the performance of API calls
Separated the API from the core HTTP code

20.02.2025
Colours can be applied to matcher elements
Matcher colours now match the colours of the elements

Time left

: