0% found this document useful (0 votes)
32 views12 pages

Introduction To A Shopping Management System Microproject

The Shopping Management System microproject aims to create a software application for managing retail or online shopping operations, focusing on product management, customer management, order processing, and inventory tracking. Key features include a user-friendly interface, shopping cart functionality, and basic reporting capabilities. This project serves as a practical learning experience for developers to enhance skills in database design and application architecture.

Uploaded by

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

Introduction To A Shopping Management System Microproject

The Shopping Management System microproject aims to create a software application for managing retail or online shopping operations, focusing on product management, customer management, order processing, and inventory tracking. Key features include a user-friendly interface, shopping cart functionality, and basic reporting capabilities. This project serves as a practical learning experience for developers to enhance skills in database design and application architecture.

Uploaded by

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

Introduction to a Shopping Management System Microproject :-

A Shopping Management System is a software application designed to help


manage and streamline the operations of a retail or online shopping environment.
The system is typically used by store managers, retailers, or e-commerce
administrators to facilitate various tasks such as product management, inventory
tracking, sales processing, customer management, and reporting.

This microproject focuses on developing a simple yet efficient Shopping


Management System that allows users to interact with the system to perform
essential shopping functions. The project will focus on essential features like
product catalog management, order processing, customer registration, and basic
reporting, making it suitable for small to medium-sized stores.

Key Objectives:
Product Management: Keep track of the products available for sale, including
their descriptions, prices, and stock quantities.

Customer Management: Allow customers to register, browse products, and


make purchases.

Order Management: Process and track customer orders, including payment


handling and order status updates.

Inventory Management: Automatically update stock levels when items are sold
and notify when stock is low.

Reports: Generate basic reports, such as total sales, stock levels, and order
histories.

Features:
User Interface: A user-friendly interface to allow customers and administrators
to interact with the system.

Search and Filter: Allow customers to search for products and apply filters (e.g.,
category, price range).

Shopping Cart: Users can add items to their cart, update quantities, or remove
items before checking out.

Order History: Customers can view their previous orders and track the status of
current orders.

Admin Dashboard: Admin users can add new products, update existing ones,
and manage orders and inventory.

Payment Gateway: Integration of basic payment processing for order


completion
#include <iostream>
#include <string>
using namespace std;

// Product class
class Product {
public:
int product_id;
string name;
float price;
int stock;

Product() {}
Product(int id, string n, float p, int s) : product_id(id), name(n), price(p), stock(s) {}

void display_info() const {


cout << "Product ID: " << product_id << ", Name: " << name
<< ", Price: $" << price << ", Stock: " << stock << endl;
}

bool is_available(int quantity) const {


return stock >= quantity;
}

void update_stock(int quantity) {


stock -= quantity;
}
};

// Customer class
class Customer {
public:
int customer_id;
string name;

Customer() {}
Customer(int id, string n) : customer_id(id), name(n) {}

void display_info() const {


cout << "Customer ID: " << customer_id << ", Name: " << name << endl;
}
};
// Order class
class Order {
public:
int order_id;
Customer customer;
Product products[10];
int quantities[10];
int product_count = 0;

Order() {}
Order(int id, Customer c) : order_id(id), customer(c) {}

void add_product(const Product &product, int quantity) {


products[product_count] = product;
quantities[product_count++] = quantity;
}

void display_order() const {


cout << "Order ID: " << order_id << ", Customer: " << customer.name << endl;
cout << "Products in order:" << endl;
for (int i = 0; i < product_count; i++) {
cout << "Product: " << products[i].name << ", Quantity: " << quantities[i]
<< ", Price: $" << products[i].price
<< ", Total: $" << (products[i].price * quantities[i]) << endl;
}
}

float calculate_total() const {


float total = 0;
for (int i = 0; i < product_count; i++) {
total += products[i].price * quantities[i];
}
return total;
}
};

// Shopping Management System class


class ShoppingManagementSystem {
private:
Product products[100];
Customer customers[100];
Order orders[100];
int product_count = 0;
int customer_count = 0;
int order_count = 0;
int order_counter = 1;
int customer_counter = 1;

public:
void add_product(int id, string name, float price, int stock) {
products[product_count++] = Product(id, name, price, stock);
cout << "Product added: " << name << endl;
}

void add_customer(string name) {


customers[customer_count++] = Customer(customer_counter++, name);
cout << "Customer added: " << name << endl;
}

void place_order() {
string customer_name;
cout << "Enter customer name: ";
cin >> ws;
getline(cin, customer_name);

Customer* customer_ptr = nullptr;


for (int i = 0; i < customer_count; ++i) {
if (customers[i].name == customer_name) {
customer_ptr = &customers[i];
break;
}
}

if (customer_ptr == nullptr) {
add_customer(customer_name);
customer_ptr = &customers[customer_count - 1];
}

Order order(order_counter++, *customer_ptr);


int product_id, quantity;

while (true) {
cout << "Enter product ID to add to order (0 to finish): ";
cin >> product_id;
if (product_id == 0) break;

Product* product_ptr = nullptr;


for (int i = 0; i < product_count; ++i) {
if (products[i].product_id == product_id) {
product_ptr = &products[i];
break;
}
}

if (product_ptr != nullptr) {
cout << "Enter quantity: ";
cin >> quantity;
if (product_ptr->is_available(quantity)) {
order.add_product(*product_ptr, quantity);
product_ptr->update_stock(quantity);
cout << "Added " << product_ptr->name << " to order." << endl;
} else {
cout << "Not enough stock for " << product_ptr->name << "!" << endl;
}
} else {
cout << "Product not found!" << endl;
}
}

orders[order_count++] = order;
cout << "Order placed successfully!" << endl;
}

void display_orders() {
if (order_count == 0) {
cout << "No orders placed." << endl;
return;
}

for (int i = 0; i < order_count; ++i) {


orders[i].display_order();
cout << "Total amount: $" << orders[i].calculate_total() << endl;
}
}

void display_products() {
if (product_count == 0) {
cout << "No products available." << endl;
return;
}
cout << "\nAvailable Products:" << endl;
for (int i = 0; i < product_count; ++i) {
products[i].display_info();
}
}
};

// Main functionality
int main() {
ShoppingManagementSystem sms;

// Adding products
sms.add_product(101, "Laptop", 800.00, 10);
sms.add_product(102, "Smartphone", 500.00, 15);
sms.add_product(103, "Headphones", 150.00, 20);
sms.add_product(104, "Tablet", 300.00, 12);
sms.add_product(105, "Smartwatch", 200.00, 8);
sms.add_product(106, "Camera", 700.00, 5);
sms.add_product(107, "Bluetooth Speaker", 120.00, 18);
sms.add_product(108, "Monitor", 220.00, 10);
sms.add_product(109, "Keyboard", 50.00, 30);
sms.add_product(110, "Mouse", 30.00, 50);
sms.add_product(111, "Air Conditioner", 1500.00, 5);
sms.add_product(112, "Refrigerator", 800.00, 7);
sms.add_product(113, "Washing Machine", 500.00, 10);
sms.add_product(114, "Microwave", 250.00, 10);
sms.add_product(115, "Blender", 100.00, 25);

int choice;
cout << "Welcome to the Shopping Management System!" << endl;

while (true) {
cout << "\n1. View Products\n2. Place Order\n3. Display Orders\n4. Exit\n";
cout << "Enter your choice: ";
cin >> choice;

switch (choice) {
case 1:
sms.display_products();
break;
case 2:
sms.place_order();
break;
case 3:
sms.display_orders();
break;
case 4:
cout << "Exiting the system. Bye!" << endl;
return 0;
default:
cout << "Invalid option. Please try again." << endl;
}
}

return 0;
}
1. Product Class

 Represents a product with details like ID, name, price, and stock.
 Methods:
o display_info(): Shows product details.
o is_available(): Checks stock availability.
o update_stock(): Updates stock after an order.

2. Customer Class

 Represents a customer with an ID and name.


 Method:
o display_info(): Shows customer details.

3. Order Class

 Represents an order with an ID, a customer, products, and quantities.


 Methods:
o add_product(): Adds products to the order.
o display_order(): Displays order details.
o calculate_total(): Calculates the total cost of the order.

4. ShoppingManagementSystem Class

 Manages products, customers, and orders.


 Methods:
o add_product(): Adds a product to the system.
o add_customer(): Adds a customer to the system.
o place_order(): Allows placing an order, checking stock, and updating
quantities.
o display_orders(): Displays all orders.
o display_products(): Displays all available products.

5. Main Functionality

 Product Setup: Adds sample products to the system.


 Menu Options:
o View available products.
o Place an order, adding products and updating stock.
o View all orders and their totals.
o Exit the program.

Key Concepts:

 Object-Oriented Programming: Uses classes and objects to organize data and behavior.
 Arrays: Used to store products, customers, and orders.
 Control Flow: Loops and conditionals handle user input and system operations.

Example Interaction:

 User can view products, place orders, and see the total cost of each order.
 New customers are added automatically if not found in the system.

Conclusion:
The Shopping Management System microproject provides a practical
learning experience in building a basic but functional retail management
tool. By completing this project, developers can enhance their skills in areas
such as database design, application architecture, and user interface
development, while providing a useful solution to everyday business
operations in a retail or e-commerce setting.

You might also like