Question

Design an OOP application for an inventory system of an online shopping portal. Create an Item class with attributes like name, price, and stock count etc. Make necessary assumption

08 Aug 2026
Answer :
Word Count : 1377
An online shopping portal requires an efficient inventory management system to store, update, and monitor information about products available for sale. An Object-Oriented Programming (OOP) approach is suitable for developing such a system because it represents each product as an object containing both data and operations. The system can be designed around an `Item` class that stores details such as item name, item ID, price, stock count, category, and other necessary information. The class can also provide methods for adding stock, reducing stock after a sale, updating the price, checking availability, and displaying item details. For the purpose of designing the application, some reasonable assumptions can be made. Every item has a unique item ID. The item name is a string, the price is represented using a numeric data type such as `double`, and stock count is represented using an integer. A product is considered available when its stock count is greater than zero. Stock cannot become negative. The inventory may contain multiple different items, and an administrator or inventory manager can add, remove, search, and modify products. Customers can purchase items only when sufficient stock is available. The main class of the application is the `Item` class. Its attributes can be declared as private to achieve encapsulation. For example, `itemId` identifies the product uniquely, `name` stores its name, `price` stores its selling price, `stockCount` stores the number of units currently available, and `category` describes the type of product. Additional attributes such as brand, discount, or reorder level can also be included when required. A possible C++ implementation of the `Item` class is: ```cpp #include #include using namespace std; class Item { private: int itemId; string name; string category; double price; int stockCount; public: Item(int id, string n, string c, double p, int stock) { itemId = id; name = n; category = c; price = p; stockCount = stock; } int getItemId() const { return itemId; } string getName() const { return name; } double getPrice() const { return price; } int getStockCount() const { return stockCount; } void setPrice(double newPrice) { if (newPrice >= 0) price = newPrice; } void addStock(int quantity) { if (quantity > 0) stockCount += quantity; } bool sellItem(int quantity) { if (quantity <= 0 || quantity > stockCount) return false; stockCount -= quantity; return true; } bool isAvailable() const { return stockCount > 0; } void display() const { cout << "Item ID: " << itemId << endl; cout << "Name: " << name << endl; cout << "Category: " << category << endl; cout << "Price: Rs.
_________ __________ ______ _____ __________ _______ ______ ______ _________ __________ __________.
_____ ______ _______ _____ _____ __________ ____ ___ __________ _________ ____ ________.
_________ __________ ___ ______ __________ ____ ____ ________ ____.
_______ ______ _______ ______ ______ ____ ________ ________ _______ _____.
____ ________ ________ _____ _________ __________.
_____ ________ __________ ________ __________ ______ ____ _____ _________.
_______ _________ ______ __________ _________ ______ ______ __________ _______.
___ _______ ______ _____ ______ ________ ____.
_____ _____ ______ ______ ______ ____.
____ ________ ____ _________ ___ ______ _______ ______ _________.
____ __________ ____ _______ _________ _______ _______.
_______ ___ ____ _______ ____ _________ ___ ___ ______ _________ _________.
______ _________ ___ _______ ___ ___ ________ _________.
____ _________ ________ _________ _________ _______ ___ ________ ___.
__________ ____ ______ __________ _________.
__________ ______ _______ _____ _________ _________ ___.
__________ _______ ___ ____ _______ ________ ______ ________ __________.
_________ _____ _____ ______ ________ _____ _________ ________ ______ _____ __________ ___.
_________ _______ _________ ___ _____ _________ _____ _____ ____ ___ _________ _____.
________ __________ __________ _______ ___ ________ _____ __________ _____ __________.
_____ _____ _________ __________ ___ __________ _________ ________ __________ _____ _________.
___ ______ _____ ______ __________ ___ ______ ______.
____ _____ ___ ___ __________ _________ __________ ___.
____ _______ _______ _______ __________ ______ __________.
_________ _____ _____ _______ ________ ________ _____ ______ ____ __________ ___.
_______ __________ ________ ________ _______ __________ ________ ____ ________ ____.
____ ____ ____ __________ ___ _______ _________ _______.
___ __________ ______ __________ _______ ______ _____.
_______ _______ ____ __________ ________ _________ ____ _________ ____.
______ ___ ______ _________ ____ ______ ________.
____ ___ ___ __________ _________ ________ ____ ____ ____ __________ _____.
__________ ___ ___ _________ _________ ______ ____ _____ _________.
______ _______ _________ ____ __________.
___ ________ _____ ____ __________ ____ ______ ___.
_________ _______ ______ ________ _________ _____ ______ ____ _________ _________.
_________ _________ ______ ___ ______ ________.
_________ _______ _______ __________ __________.
________ ______ _____ ___ __________ _______ ______ ____.
______ _________ ____ _________ _____ ________ ____ ________ ______ __________ _________ _____.
___ _______ ________ _____ ______ _________ __________ ___ ____.
______ _________ ______ ____ ___ ____ ________ ____ _________ ________ _______ _________.
_________ ______ _____ ______ ______ ________ ________ _______.
__________ ____ ____ ______ _________ _____ __________.
_____ __________ _________ ____ ___ ________ ____ ___ __________ __________.
____ _______ ___ _______ _____ ____.
_____ _________ ___ __________ ___ _________ _______ __________ ____ ______ ___.
__________ ________ ________ _______ __________ _________ _________ _____ __________.
__________ __________ _____ _____ ____ _________ ___ ___ __________.
_______ ____ ____ ________ _________ _______ ________ ____.
_____ _______ _____ _____ _________ ________ _________ __________ _____ ______ _______ ____.
_____ ___ ____ _________ ___ ____ ______ ___ ____ __________.
_____ ___ ___ _______ _________ ___ _______ _____ ___ _____.
__________ ____ _____ ___ _______ ______ ________ _______ _________ ______ _____.
______ ___ _____ ____ ________ _____.
__________ ________ _______ _______ ______ ____ _________ __________ ____ _______ _____ ________.
______ ________ ___ ________ __________ ______ ___ _________ _________ _______ __________ _________.
___ __________ ________ ________ _________ ____ ____ _______ ___ _______.
________ ______ _________ ___ ________ ________ ________ ___.
____ ______ ______ ________ ___.
_________ ___ _____ _______ _______.
_________ _____ ___ _______ __________ _____ __________ __________ ____ ___ ___.
___ __________ ______ _______ _____ ___ ______ ______ _________ _________ ________.
___ __________ _______ ______ ______ __________ ______ __________ _____.
________ ______ ___ _______ __________ ___ _______ _______.
________ ________ ________ _______ ____ ______ __________ ___ ____.
__________ _____ _________ ___ _______ ______ ______ _______.
___ ___ ___ ____ _____ _________ _____.
___ __________ ____ _______ __________ _________ ________ __________ ___ _______ __________ ____.
______ ________ _______ ________ ________ ____ _________ ___ _________ ____ _________.
____ _________ ____ ___ _______ ______ _____ _________.
______ _____ _____ ___ ______ ___.
______ _______ _____ ____ _________ ______ _______ _____ _______ ____ ____ ________.
______ ___ ________ ______ ___ ___ ________ ______.
__________ ____ ________ _________ ______ ______ ___ ______ ______.
______ _______ ________ ____ ___ _______ ____ _____ _____ _______ ________ ____.
___ __________ _______ _______ ______ ____ ___ ______ ______.
_____ _______ ___ ______ __________ _______ ___ _________ ____ ______ __________ ______.
_____ _______ _________ ______ ______ _______ _______ _______.
__________ ____ ____ _____ ______ ______ _____ ________ ________.
____ _____ ________ __________ __________ ______.
________ _____ ____ __________ _________ _________ __________ __________ __________ ___.
__________ ___ _______ _________ ___ _______ _____ _______ ___ __________.
__________ ______ _____ _________ ________ ________ _______ ____ __________ ______ __________.
___ ______ ______ _____ __________ ______ ______ ____ __________ _______.
___ _____ _____ ___ ______ ________ _______ __________ ______ _________.
______ ________ _________ ____ ___ _____ _______.
_________ __________ _________ ______ ___ _________ __________ _______.
________ ________ ___ ______ _________ _________ ______ _________ ___ __________ ________ ________.
___ ____ ___ ___ ____ _____ __________ ________ _______ _________ ____.
_______ ____ ______ ____ _______ ________ ________ _______ __________.
___ ______ ____ _________ ___.
____ ______ _________ __________ _____ ____ __________ _________.
_________ ____ ________ _____ ____ ___ _________ ____ ___ ________ __________ ____.
___ __________ _________ ______ ___.
___ _________ ______ _____ ___ ________ __________ _____ _________.
_____ _____ _________ _____ _______ _______ ____ ____.
___ ___ ______ _________ ___ ________ _________ _____.
________ _____ ________ _________ _________ ___ ___ ___ _______.
______ _______ _____ _______ ________ ________ ________ _____ __________ ___ _________ ___.
_______ _________ __________ _______ _____ _____ _______ _________ ______.
_______ _____ ________ _________ __________ ___ ______ ____ ____ __________ _____.
_________ ___ ________ ________ _______ ______ ___ ___ _______ __________ _________ ____.
___ _______ _____ ________ _________ ________ _________ _____ ____ ______ __________ _________.
__________ ____ _______ _______ ____ ______ ___.
________ _________ ________ _____ ________ ___ ________ ________.
__________ ________ _________ ___.
IGNOU ACADEMY
Your IGNOU journey, made easier.
  • Solved Assignments
  • Study Notes
  • Guess Papers
  • Question Papers
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU MCSL-083 2026 - Design an OOP application for an inventory system of an online shoppin | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→