GithubHelp home page GithubHelp logo

jidris-spec / updating-online-product Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3 KB

This is a simple product management system implemented in Python. It allows you to add, update, and manage products, as well as track available stock and handle sales.

Python 100.00%

updating-online-product's Introduction

Product Management System

This is a simple product management system implemented in Python. It allows you to add, update, and manage products, as well as track available stock and handle sales.

Features

Add Product: Add a new product to the catalog. Update Price: Update the price of an existing product. Update Quantity: Update the quantity of an existing product. Sell Product: Sell a specified quantity of a product. Available Stock: View all available products and their details.

Class Structure

Product

The Product class manages individual products and maintains a catalog of all products.

Attributes

  • product_id: Unique identifier for the product.
  • product_name: Name of the product.
  • product_description: Description of the product.
  • product_price: Price of the product.
  • product_quantity: Quantity of the product available in stock.
  • online_products: Class dictionary to store all products.

Methods

  • __init__(self, product_id, product_name, product_description, product_price, product_quantity): Initializes a new product and adds it to the catalog.
  • add_product(self): Prompts user input to add a new product.
  • update_price(self, new_price): Updates the price of the product.
  • update_quantity(self, new_quantity): Updates the quantity of the product.
  • sell(self, quantity_sold): Sells a specified quantity of the product.
  • available_stock(cls): Class method to display all available products and their details.
  • start(cls): Class method to start the interactive menu for managing products.

Getting Started

To get started with this project, clone the repository and run the script.

Prerequisites

  • Python 3.x

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/product-management-system.git
  2. Navigate to the project directory:

    cd product-management-system
  3. Run the script:

    python product_management.py

Usage

When you run the script, you will see a menu with the following options:

  1. Available stock: View all products in the catalog.
  2. Update price: Update the price of an existing product.
  3. Update quantity: Update the quantity of an existing product.
  4. Purchase: Sell a specified quantity of a product.
  5. Add new product: Add a new product to the catalog.
  6. Exit: Exit the program.

Follow the prompts to manage the products in your catalog.

Example

An initial product is created for demonstration purposes:

  • Product ID: 12345
  • Product Name: Toyota Yaris
  • Description: Fairly used car
  • Price: $1500.00
  • Quantity: 10

Run the script and use the menu to interact with this product and add new ones.

updating-online-product's People

Contributors

jidris-spec avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.