Smart Inventory Billing System
A console-based inventory management and billing application developed in C, designed to demonstrate core programming concepts like Structures, Pointers, Dynamic Memory Allocation, and Conditional Logic.
This system provides a full-cycle solution for inventory management, stock updates, and sales transactions:
- Dynamic Inventory Allocation: Uses
mallocfor dynamic memory allocation. - Inventory Management: Displays current stock, including product code, name, price, and quantity.
- Search & Update: Users can search and modify product details (price or stock) by its unique code.
- Sales Transactions: Allows for multi-item billing in a single session.
- Stock Validation: Prevents sales if the requested quantity exceeds the available stock.
- Conditional Discounts: Automatically applies discounts based on the quantity purchased:
- 5% Discount: For quantities of 5 or more.
- 10% Discount: For quantities of 10 or more.
- Final Bill Generation: Calculates and displays a detailed receipt, including Gross Total, Discounts, Net Subtotal, GST (18% Tax), and the Final Amount Due.
- Language: C
- IDE: VS CODE
- Compiler: MinGW
- Core Concepts: Structures, Pointers, Dynamic Arrays, Modular Programming (using
.cand.hfiles).
This project is built using modular programming, split across several source files (.c), which requires a C compiler (like GCC) to link them together into a single executable program.
You must have the GCC (GNU Compiler Collection) installed on your system.
-
Place all the project files (
core.c,main.c,search.c,transaction.c, andproject.h) into the same folder. -
Open your Terminal or Command Prompt and navigate to the project directory.
-
Run the following command to compile and link the files:
gcc core.c main.c search.c transaction.c -o program.exe
- This command creates the executable file named
program.exe. - Note: The header file (
project.h) is included in the source files, not in the compilation command.
- This command creates the executable file named
Execute the compiled program from your terminal:
./program.exeUpon starting, you'll be prompted to enter the initial number of products, followed by their details (Code, Name, Price, Stock).
The main menu will then appear for operations:
| Menu Option | Description |
|---|---|
| 1. View Current Inventory Stock | Displays a formatted table of all products. |
| 2. Search for a Product | Finds and displays details using its unique code. |
| 3. Modify Product Details | Allows updating the unit price or adding stock. |
| 4. Start New Billing Transaction | Begins the multi-item sales process. |
| 5. Finalize Bill and Exit System | Calculates the final bill, prints the receipt, and terminates the program. |
If you find an issue or have suggestions for improvement, please open an issue or submit a pull request.
This project is for educational purposes only.