CPP Certificate MICRO PROJRCT
CPP Certificate MICRO PROJRCT
’´”
Submitted by:
Mr. Kishor Ramdas Gaikar
Mr. Nikhil Prakash khobre
Mr. Gaurav Bhausaheb khainar
1|Page
LOKNETE GOPALRAOJI GULVE POLYTECHNIC
VILHOLI, NASHIK
CERTIFICATE
This is to certify that
Mr. Kishor Ramdas Gaikar
Mr. Nikhil Prakash khobre
Mr. Gaurav Bhausaheb khainar
Principal
2|Page
INDEX
Sr.No Title Pg.No
1. Introduction
2. Source Code
3. Result
4. Conclusion
5.
Reference
3|Page
INTRODUCTION:
4|Page
1. Classes: Define classes for Customer, Product, and
Invoice.
o Customer: Contains attributes like name, address,
and contact details.
o Product: Contains attributes like product ID, name,
price, and quantity.
o Invoice: Contains details about the transaction,
including the customer, products purchased, total
amount, and payment status.
2. Functions: Implement functions for:
o Adding and updating customer and product
information.
o Generating invoices and printing them.
o Calculating totals and taxes.
o Saving and loading data from files.
3. User Interface: Create a simple text-based interface that
allows users to navigate through options, such as adding
customers, generating invoices, and viewing reports.
5|Page
ADVANTAGE OF BILLING SYSTEM:
1. Performance:
o C++ is a compiled language, which often leads to
faster execution times compared to interpreted
languages. This can be particularly beneficial when
processing large datasets or handling complex
calculations.
2. Efficiency:
o The language allows for fine-tuned memory
management, which can optimize resource usage
and improve performance, especially in
applications that need to handle multiple
transactions simultaneously.
3. Object-Oriented Programming:
o C++ supports object-oriented principles, enabling
you to create modular and reusable code through
classes and objects. This makes it easier to manage
different components of the billing system, such as
customers, products, and invoices.
4. Robust Data Structures:
o C++ provides a range of data structures (like
vectors, lists, and maps) that can be used to
efficiently manage customer and product
information. This facilitates quick access and
manipulation of data.
6|Page
5. File Handling:
o C++ offers powerful file I/O capabilities, allowing
for effective storage and retrieval of billing data.
This is crucial for maintaining records, generating
reports, and ensuring data persistence.
6. Cross-Platform Development:
o C++ applications can be compiled and run on
various platforms with minimal changes to the
code, making it easier to deploy your billing system
across different operating systems.
7. Integration Capabilities:
o C++ can easily integrate with other languages and
systems, allowing you to extend your billing
system's functionalities, such as connecting to
databases or integrating with web services.
8. Error Handling:
o C++ provides mechanisms for exception handling,
which can help you build a more robust billing
system by managing errors gracefully and ensuring
data integrity.
9. Scalability:
o As business needs grow, a C++ billing system can be
easily expanded to include additional features or
accommodate larger datasets without significant
performance.
7|Page
SOURCE CODE:
#include <iostream>
#include <vector>
#include <string>
#include <iomanip>
8|Page
class Product {
public:
int id;
string name;
double price;
void addProduct(Product p) {
products.push_back(p);
9|Page
totalAmount += p.price;
}
void generateInvoice() {
cout << "\n----- INVOICE -----\n";
cout << "Customer: " << customer.name << "\n";
cout << "Address: " << customer.address << "\n";
cout << "Contact: " << customer.contact << "\n";
cout << "\nProducts:\n";
cout << "Total Amount: $" << fixed << setprecision(2) <<
totalAmount << "\n";
cout << "-------------------\n";
}
};
10 | P a g e
// Function to display menu options
void displayMenu() {
cout << "\n----- BILLING SYSTEM -----\n";
cout << "1. Add Customer\n";
cout << "2. Add Product\n";
cout << "3. Create Invoice\n";
cout << "4. Exit\n";
cout << "Choose an option: ";
}
int choice;
while (true) {
displayMenu();
cin >> choice;
11 | P a g e
switch (choice) {
case 1: {
string name, address, contact;
cout << "Enter customer name: ";
cin >> name;
cout << "Enter customer address: ";
cin >> address;
cout << "Enter customer contact: ";
cin >> contact;
customers.emplace_back(name, address, contact);
cout << "Customer added!\n";
break;
}
case 2: {
int id;
string name;
double price;
cout << "Enter product ID: ";
cin >> id;
12 | P a g e
cout << "Enter product name: ";
cin >> name;
cout << "Enter product price: ";
cin >> price;
products.emplace_back(id, name, price);
cout << "Product added!\n";
break;
}
case 3: {
if (customers.empty() || products.empty()) {
cout << "Please add customers and products first.\
n";
break;
}
string customerName;
cout << "Enter customer name for the invoice: ";
cin >> customerName;
13 | P a g e
Customer selectedCustomer = customers[0]; //
Default customer
for (const auto& customer : customers) {
if (customer.name == customerName) {
selectedCustomer = customer;
break;
}
}
Invoice invoice(selectedCustomer);
char addMore = 'y';
14 | P a g e
cout << "Product added to invoice.\n";
break;
}
}
invoice.generateInvoice();
break;
}
case 4:
cout << "Exiting the system. Goodbye!\n";
return 0;
default:
cout << "Invalid option! Please try again.\n";
}
}
}
15 | P a g e
16 | P a g e
17 | P a g e
CONCLUSION:
REFRENCE:
TURBO C++
VS CODE
OPPS NOTES
COMPUTER
18 | P a g e