https://github.com/zohaibcodez/cashmemo-cpp
๐งพ Modular C++ cash memo (billing system) using OOP and Makefile
https://github.com/zohaibcodez/cashmemo-cpp
beginner-project billing-system cash-memo cli-application cpp makefile modular-programming oop
Last synced: 7 months ago
JSON representation
๐งพ Modular C++ cash memo (billing system) using OOP and Makefile
- Host: GitHub
- URL: https://github.com/zohaibcodez/cashmemo-cpp
- Owner: ZohaibCodez
- License: mit
- Created: 2025-06-21T18:55:29.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-06-21T19:58:28.000Z (8 months ago)
- Last Synced: 2025-06-21T20:33:26.020Z (8 months ago)
- Topics: beginner-project, billing-system, cash-memo, cli-application, cpp, makefile, modular-programming, oop
- Language: C++
- Homepage: https://zohaibcodez.github.io/cashmemo-cpp/
- Size: 172 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐งพ Cash Memo System in C++
A console-based C++ application designed to generate cash memos or receipts. This project demonstrates core object-oriented programming (OOP) principles, including class design, encapsulation, and operator overloading. It is structured professionally with separate header and implementation files and is built using a `Makefile`.
---
## โจ Features
- **Dynamic Data Entry**: Captures all necessary details for a cash memo, including shop information, customer details, and item specifics.
- **Formatted Output**: Generates a clean, well-formatted cash memo ready for display.
- **Input Validation**: Ensures that data like names, numbers, and dates are entered in a valid format.
- **OOP Design**: Utilizes a collection of classes to model real-world entities like `Item`, `Date`, and `Address`.
- **Makefile Build System**: Includes a straightforward `Makefile` for easy compilation and execution.
---
## ๐ Project Structure
The project is organized into `include` and `src` directories to separate class declarations from their implementations.
```
cashmemo-cpp/
โโโ include/
โ โโโ Address.h
โ โโโ CashMemo.h
โ โโโ CellNumber.h
โ โโโ Date.h
โ โโโ Item.h
โ โโโ Name.h
โ โโโ ReceiptNo.h
โ โโโ ShopDetails.h
โ
โโโ src/
โ โโโ Address.cpp
โ โโโ cashmemo_app.cpp (Main application entry point)
โ โโโ CashMemo.cpp
โ โโโ CellNumber.cpp
โ โโโ Date.cpp
โ โโโ Item.cpp
โ โโโ Name.cpp
โ โโโ ReceiptNo.cpp
โ โโโ ShopDetails.cpp
โ
โโโ build/ (Created automatically by the Makefile)
โโโ Makefile (To compile and run the project)
โโโ .gitignore (Specifies files for Git to ignore)
โโโ README.md (This file)
```
---
## โ๏ธ How to Build and Run
This project uses a `Makefile` to automate the build process. Ensure you have `g++` and `make` installed on your system.
Open a terminal in the project's root directory and use the following commands:
**1. To compile the project:**
This command compiles all source files and links them into an executable located in `build/bin/`.
```bash
make
```
**2. To compile and run the project:**
```bash
make run
```
**3. To clean the build directory:**
This command removes all compiled files.
```bash
make clean
```
---
## ๐ฅ๏ธ Sample Usage
Here is an example of the program's input and output flow:
```
$ make run
SHOP DETAILS
Enter Shop First Name : Super
Enter Shop Last Name : Electronics
Enter Shop Description : Quality Gadgets
Shop's Owner Name
Enter first name: Zohaib
Enter middle name: (or '-' to skip)-
Enter last name: Khan
CellInfo
Enter Country Code : 92
Enter Number : 3001234567
Address Info
Street No : 123
City : Islamabad
Country : Pakistan
Enter date (DD MM YYYY): 22 6 2024
CUSTOMER'S INFO
Enter first name: Ali
Enter middle name: (or '-' to skip)-
Enter last name: Ahmed
Enter 2 Items:
Enter particular: Wireless Mouse
Enter quantity: 1
Enter rate: 1500
Enter particular: Keyboard
Enter quantity: 1
Enter rate: 2500
------------------------------------------------------
Super Electronics
------------------------------------------------------
Quality Gadgets
Cell : +92 3001234567
No: 1001 Date: 22-6-2024
Name: Ali Ahmed
------------------------------------------------------
Qty Particulars Rate Amount
------------------------------------------------------
1 Wireless Mouse 1500.00 1500.00
1 Keyboard 2500.00 2500.00
------------------------------------------------------
Total: 4000.00
------------------------------------------------------
Signature: Zohaib Khan
Address : Street # 123, Islamabad, Pakistan
```
---
## ๐งฉ Core Classes
- **`CashMemo`**: The main class that aggregates all other components to form the final receipt.
- **`ShopDetails`**: Manages the store's information, such as its name, address, and contact details.
- **`Item`**: Represents a single item in the memo, including its quantity, name, rate, and total amount.
- **`Name`**, **`Address`**, **`CellNumber`**, **`Date`**, **`ReceiptNo`**: Helper classes that model individual data components with their own logic and validation.
---
## ๐จโ๐ป Author
Developed By **Zohaib Khan** ๐
## ๐ License
MIT License ยฉ 2025 [Zohaib Khan](https://github.com/ZohaibCodez).