oopfinal
oopfinal
The objective of this project is to develop a Store Management System using Object-Oriented
Programming (OOP) principles in C++. This system will assist store owners in managing their
inventory efficiently by allowing the addition, deletion, updating, and display of product
information.
This system has practical applications in any retail or inventory-based environment, where
maintaining accurate and accessible records of products is essential. Future improvements
could include implementing a graphical user interface, adding search functionality, and enabling
export of inventory data to other systems.
Requirements
Hardware Requirements:
• Standard computer with 4GB RAM and 1 GHz processor
Software Requirements:
• C++ Compiler (such as GCC or Visual Studio)
• Code Editor (such as Visual Studio Code or Code::Blocks)
Action Plan
Code Implementation
Below is the complete C++ code for the Store Management System, showcasing all
functionalities including adding, displaying, updating, and deleting products:
#include <iostream>
#include <vector>
#include <string>
class Product {
public:
int id;
string name;
int quantity;
float price;
class StoreManagement {
private:
vector<Product> products;
public:
void addProduct(int id, string name, int quantity, float price) {
Product newProduct(id, name, quantity, price);
products.push_back(newProduct);
cout << "Product added successfully!" << endl;
}
void displayProducts() {
cout << "\nList of Products:\n";
for (Product &p : products) {
p.display();
}
}
int main() {
StoreManagement store;
store.addProduct(1, "Laptop", 5, 999.99);
store.addProduct(2, "Smartphone", 10, 499.99);
store.displayProducts();
store.updateProduct(1, "Laptop", 3, 950.00);
store.displayProducts();
store.deleteProduct(2);
store.displayProducts();
return 0;
}
Output
1. **Adding a Product**:
- Input: `store.addProduct(1, "Laptop", 5, 999.99);`
- Output: Product added successfully!
2. **Displaying Products**:
- Output:
`ID: 1, Name: Laptop, Quantity: 5, Price: $999.99`
4. **Deleting a Product**:
- Input: `store.deleteProduct(2);`
- Output: Product deleted successfully!
Conclusion
The Store Management System microproject provided an in-depth understanding of the application
of Object-Oriented Programming (OOP) principles such as encapsulation, inheritance, and
polymorphism in solving real-world problems. Through the development of this project, we
explored how OOP can be used to design a modular, scalable, and efficient solution for managing
various store operations.
The system successfully implements functionalities such as adding products, displaying product
lists, searching for specific products, applying bulk discounts, and sorting products based on price.
These features demonstrate the relevance of key programming concepts like data abstraction,
vector usage for dynamic data handling, and functional decomposition for better program
structure.
One of the most notable aspects of this project is the inclusion of unique operations like bulk
discount calculation and product sorting. These additions make the system more practical and user-
friendly, showing how additional features can enhance functionality while maintaining simplicity.
Such innovations reflect how C++ can be leveraged to address real-life business needs effectively.
Moreover, this project highlights how a store management system can serve as the foundation for
more complex systems like inventory management, billing software, or e-commerce platforms.
With further development, this system can be expanded to include features like:
Multi-user authentication.
In conclusion, this microproject not only deepened our understanding of programming but also
showcased the importance of software solutions in automating and simplifying daily tasks. It
exemplifies how programming skills can be applied to create meaningful and impactful systems,
preparing us for future projects and real-world challenges in software development.