Developed By: Jayshree Chauhan
The aim of this project is to develop an automatic bill receipt generator using a predefined file template.
This project showcases the use of the following C programming concepts:
- File I/O: Reading from and writing to files.
- Pointers: Efficient memory management and data manipulation.
- Strings: Handling and manipulating text data.
- Functions: Modularizing the code into reusable blocks.
- Dynamic Memory Allocation: Allocating and reallocating memory dynamically to handle varying data sizes and ensure efficient memory usage.
In this project:
- A bill template is referenced from a file (
BillTemplate.txt), which serves as the base structure for the receipt. - The user is prompted to input their name.
- Additional predefined strings, such as the company name, bill amount, and outlet name, are incorporated into the receipt.
- A new string is generated by combining the user input and predefined data.
- The updated data is saved in a new file, creating a complete and personalized bill receipt.
- Clone the repository or download the source code.
- Ensure the file
BillTemplate.txtexists in the same directory as the program. - Compile the C program using any standard C compiler (e.g., GCC).
gcc Auto_Bill_Generator.c -o Auto_Bill_Generator
- Run the executable:
./Auto_Bill_Generator
- Follow the on-screen instructions to input your name and generate the bill receipt.
------------------| [CUSTOMER_NAME]'s Bill |------------------
Company Name: [COMPANY_NAME]
Outlet: [OUTLET_NAME]
Customer Name: [CUSTOMER_NAME]
Bill Amount: [BILL_AMOUNT] Rs.
Thanks [CUSTOMER_NAME] for your purchase! Do visit again.
When the program runs, it will generate a new file like this:
Generated File: bill.txt
------------------| Jayshree Chauhan's Bill |------------------
Company Name: GRUB GARAGE
Outlet: BARODA OUTLET
Customer Name: Jayshree Chauhan
Bill Amount: 1000.0 Rs.
Thanks Jayshree Chauhan for your purchase! Do visit again.
Feel free to contribute to this project or suggest improvements!