Itfilenew
Itfilenew
Bachelor of Technology in
SUBMITTED TO SUBMITTED BY
Autonomous status conferred by UGC under UGC act-1956, (2f), NAAC-A Grade,
(Formerly Known as Amritsar College of Engineering & Technology | Amritsar Pharmacy College
PROJECT ORGANIZATION
The successful implementation and completion of the School/College Car Rental Management System
project were made possible by the collaboration of the following team members, each with their specific
roles and responsibilities:
Role: Deepak was responsible for the coding and concept building aspects of the project. He played
important role in developing the technical architecture, coding modules, and ensuring the project's
technical integrity.
Role: Kanwaldeep Singh was also responsible for coding and concept building. His contributions to
the project's technical aspects, including algorithm design and coding, were instrumental in the
project's success.
Role: Gurjot Singh was responsible for project report writing. He meticulously documented the
project's progress, key milestones, and outcomes. Gurjot ensured that the project report was
comprehensive and accurately reflected the project's development and achievements.
This collaborative effort among Deepak, Kanwaldeep Singh, and Gurjot Singh contributed to the successful
creation of the School/College Car Rental Management System . Their individual strengths and contributions
were vital to the project's overall success.
ACKNOWLEDGEMENT
It is our proud privilege to release the feelings of our gratitude to several persons who helped us
directly or indirectly to conduct this Analysis Project Work. We express our heartful thanks and
owe a deep sense of gratitude to my faculty guide Er. Veenum Devi, Assistant Professor
Department of CSE, Amritsar Group of Colleges, Amritsar, for her
guidance and inspiration in completing this project.
We are extremely thankful to the Mr.Sandeep Kad, Head of Department and all
faculty members of Computer Science and Engineering Department at Amritsar Group of
Colleges, Amritsar for their co-operation, kind guidance and encouragement.
We also thank all our friends who have more or less contributed to the preparation of
This project completion has indeed helped us explore more knowledge avenues related to
We Deepak, Kanwaldeep Singh, Gurjot Singh hereby as a team declare that the project
work entitled “CAR RENTAL MANAGEMENT SYSTEM” is an authentic record of
our own work carried out as per the requirements of Institutional Training Labs (PartB)
for the award of degree of B.Tech (CSE), Amritsar Group of Colleges, Amritsar, under
the guidance of Er. Veenum Devi (Assistant Professor).
3. Scope Of Project 11
4. Objectives Of Project 12
5. Methodology 13-14
7. Tools Used 15
9. Appendix 21-34
Certainly, here's an introduction to the C++ programming language. This is a concise introduction and may
not cover all aspects in great detail, but it should provide a good starting point for understanding C++
---
C++ is a powerful and versatile programming language that has been widely used in software development
for several decades. It is an extension of the C programming language and is known for its efficiency,
flexibility, and extensive libraries. C++ finds applications in various domains, including system
programming, game development, embedded systems, and much more. This introduction aims to provide an
overview of C++ and its key features.
History of C++
C++ was developed by Bjarne Stroustrup in the early 1980s at Bell Labs as an extension of the C
programming language. Stroustrup's goal was to create a language that combined the low-level capabilities
of C with high-level features to make software development more efficient and safer. The first standardized
version of C++, known as C++98, was published in 1998. Since then, the language has evolved, and various
standards, such as C++11, C++14, C++17, and C++20, have been released with significant improvements
and new features.
Page 6
Key Features of C++
1. Object-Oriented Programming
C++ is an object-oriented programming (OOP) language. It allows developers to structure their code into
classes and objects, facilitating the modeling of real-world entities and relationships. This approach enhances
code reusability, maintainability, and organization. In C++, you can create classes to represent objects and
define methods to operate on those objects.
2. Efficiency
One of C++'s primary strengths is its ability to produce efficient code. It offers low-level memory
manipulation through pointers and allows developers to control memory allocation and deallocation. This is
crucial in systems programming, game development, and other performance-critical applications.
C++ includes a comprehensive Standard Template Library (STL) that provides a rich collection of data
structures (e.g., vectors, lists, maps) andalgorithms(e.g.,sorting,searching)that simplify common
programming tasks. The STL is a vital component of C++ that boosts productivity and code quality
Page 7
4. Portability
C++ is a platform-independent language. Code written in C++ can be compiled and executed on various
operating systems, making it an attractive choice for cross-platform development.
This portability is due to the availability of C++ compilers for different platforms.
5. Multi-Paradigm Language
C++ is not limited to just OOP; it supports multiple programming paradigms. In addition to OOP, C++ allows
procedural programming and generic programming through template metaprogramming. This versatility
enables developers to choose the most suitable approach for a given task.
C++ has a vast and active community of developers and a rich ecosystem of libraries and frameworks. This
ecosystem includes libraries for graphics, networking, scientific computing, game development, and more.
The open-source nature of C++ development has led to the creation of numerous resources and tools.
7. C++ in Practice
*System Programming:* Operating systems, device drivers, and other low-level software are often
written in C++ because of its control over hardware resources.
*Game Development:* C++ is a popular choice for game development due to its performance and ability to
interact with graphics libraries like OpenGL and DirectX
Page 8
*Embedded Systems:* C++ is used in developing firmware and software for embedded systems, such as
microcontrollers and IoT devices.
*Financial Software:* C++ is used in the development of trading platforms, financial modeling, and risk
analysis software due to its speed and precision.
8. Memory Management
C++ provides control over memory management. You can allocate and deallocate memory explicitly, which
is both a strength and a potential source of errors. Modern C++ practices recommend using smart pointers and
containers to minimize manual memory management.
9. Debugging Tools
C++ has excellent debugging tools, including gdb for GNU-based systems and Visual Studio Debugger for
Windows, which help developers identify and fix issues efficiently.
Page 9
INTRODUCTION TO PROJECT
In today's fast-paced world, mobility and convenience have become key factors in our lives.
With the rise of the sharing economy, car rental services have gained tremendous popularity. The Car Rental
System project is designed to offer a seamless and efficient solution for managing car rentals. This project
serves as a practical and illustrative example of an interactive C++ application for car rental businesses and
rental management systems.
Project Background
Car rental businesses cater to a wide range of customers, including tourists, business travelers, and local
residents in need of temporary transportation. Efficiently managing the rental process is paramount in
ensuring customer satisfaction and the profitability of such businesses. The Car Rental System is an attempt
to address the operational challenges faced by these businesses by providing a digital platform for users to
rent vehicles easily and securely.
Page 10
Motivation
The motivation behind developing this project is to streamline the car rental process. Traditional, paper-based methods
of record-keeping and manual billing are error-prone and time-consuming. By leveraging technology, the Car Rental
System aims to automate theseprocesses, making it convenient for both the service provider and the customers. The
system also prioritizes the security and privacy of user data through authentication procedures.
The Car Rental System is a C++ application designed to manage the rental of cars. It allows users to rent and return
cars, generate rental bills, and provides authentication for authorized users. The system supports three car companies
(Hyundai, BMW, and Rolls Royce) with a variety of car models, prices, and colors.
SCOPE OF PROJECT
The scope of the Car Rental System encompasses several key features:
- *Car Selection:* Once authenticated, users can browse and select cars from three renowned car companies: Hyundai,
BMW, and Rolls Royce. The system displays available models, their respective prices, and colors.
- *Rental Cost Calculation:* After choosing a car, the user enters the number of rental days. The system calculates the
total rental cost based on the car's daily rate and the chosen rental duration.
- *Rental Billing:* The Car Rental System generates detailed rental bills, including customer information, car details,
rental duration, and total cost. These bills are stored in a file for future reference and can be accessed by use.
Page 11
OBJECTIVES OF PROJECT
1. *User Convenience:* To provide an easy and efficient way for customers to rent cars, ultimately saving
their time and effort.
2. *Error Reduction:* To minimize errors associated with manual billing and recordkeeping, improving
the accuracy and reliability of rental operations.
3. *Security:* To ensure that only authorized users can access the system, protecting user data and the
integrity of the car rental process.
4. *Inventory Management:* Beyond vehicles, car rental companies may offer various accessories and add-
ons (e.g., GPS devices, child seats, insurance options). The system should enable easy tracking and
management of these additional items, ensuring they are available when customers request them.
5. *Payment Processing:* A seamless and secure payment processing system is vital. The system should
support various payment methods, manage billing, and automate the handling of deposits, refunds, and
invoices. Integration with payment gateways and compliance with relevant financial regulations are important
considerations.
Page 12
METHODOLOGY
Modules
1. *User Authentication Module:* Authenticates users based on a username and password stored in a file
(`user.txt`).
2.*Car Selection Module:* Allows users to select cars from available models.
3.*Rental Cost Calculation Module:* Calculates the rental cost based on the selected car and the number
of rental days.
4.*Rental Bill Generation Module:* Generates rental bills and saves them to a file (`rental_history.txt`).
----->Data Flow
3.Rental bills are generated, displayed to the user, and saved to `rental_history.txt`.
• No of classes used = 3
1.`Car`: Represents car information, including company, model, price, color, and tracking information for the
user who rented the car.
3.`Rental`: Represents a rental transaction, including the user, car, rental days, and total cost.
These classes encapsulate the data and behavior relevant to the car rental service and are utilized in the
program to manage car rentals and user interactions.
Page 13
• In this code for a car rental service, here are the important functions:
1. `getUserData()`: Function to input user data, including name and contact information.
2. `authenticateUser()`: Function to perform user authentication, requiring the user to enter a username and
password.
3. `selectCar()`: Function to select a car from the menu based on the user's choice of car company.
4. `calculateRentalCost()`: Function to calculate the rental cost based on the selected car and the number of rental
days.
5. `rentCar()`: Function to rent a car, including choosing a car, specifying the number of rental days, and generating a
rental bill.
6. `returnCar()`: Function to return a rented car, allowing the user to select a rental bill to view and delete.
7. `generateBill()`: Function to generate and print the rental bill and save it to a file.
8. `main()`: The main function where the program execution begins. It initializes car data, authenticates the user, and
provides a menu for renting, returning, or exiting.
These functions together form the core functionality of the car rental service program.
Page 14
HARDWARE & SOFTWARE REQUIREMENTS
• Any hardware is fine as long as it has 100mb free memory and has c++ compiler installed.
• Compiler : The program can be compiled and executed with a C++ compiler, such as:
TOOLS USED
- Input and output operations are performed using the standard C++ `` library.
- user.txt - rental_history.txt
Page 15
RESULTS AND DISCUSSION
1.Login:
Page 16
2. Menu:
3. Rent a car:
Page 17
Page 18
4. History:
5. Return a car:
Page 19
6. Remove car history:
Page 20
APPENDIX
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <conio.h>
using namespace std;
class Car {
public:
string company;
string model;
double price;
string color;
string rentedBy;
void returnCar() {
rentedBy = "";
Page 21
}
};
class User {
public:
string name;
string contact;
class Rental {
public:
User user;
Car car;
int rentalDays;
double totalCost;
Rental(const User& user, const Car& car, int rentalDays, double totalCost)
: user(user), car(car), rentalDays(rentalDays), totalCost(totalCost) {}
};
bool authenticateUser() {
string username, password;
cout << "\t\t\t:::::::::::Enter Username::::::::::\n"<<endl;
cout<<"\t\t\t**********************************"<<endl;
cin >> username;
char ch;
cout << "\t\t\t:::::::::::Enter Password::::::::::\n"<<endl;
cout<<"\t\t\t**********************************"<<endl;
password = "";
ch = _getch();
while (ch != 13) {
password.push_back(ch);
cout << '*';
ch = _getch();
}
cout << endl;
Page 23
ifstream userFile("user.txt");
if (userFile.is_open()) {
string storedUsername, storedPassword;
userFile >> storedUsername >> storedPassword;
userFile.close();
Page 24
for (int i = 0; i < numCars; i++) {
if (cars[i].company == companyName && !cars[i].isRented()) {
noAvailableCars = false;
cout << i + 1 << ". " << cars[i].model << " - $" << cars[i].price << " - Color: " <<
cars[i].color << endl;
}
}
if (noAvailableCars) {
cout << "!!!!!!!!!!!!No Available Cars For!!!!!!!!!!!!!!" << companyName <<
"!!!!!!!Exiting.............." << endl;
return Car("", "", 0.0, "");
}
cout << endl;
cout << "Enter Your Choice :";
cin >> choice;
Page 25
void rentCar(User& user, Car cars[], int numCars) {
int choice;
cout << "\t\t\t|*********************************************|\n";
cout << "\t\t\t| DEEPAK CAR RENTAL MENU: | \n";
cout << "\t\t\t|*********************************************|\n\n";
cout << " 1. Hyundai" << endl;
cout << " 2. BMW" << endl;
cout << " 3. Rolls Royce" << endl;
cout << " 4. Exit" << endl<<endl;
cout << "Enter your choice (1-4): ";
cin >> choice;
if (choice == 4) {
exit(0);
}
string companyName;
switch (choice) {
case 1:
companyName = "Hyundai";
break;
case 2:
companyName = "BMW";
break;
case 3:
companyName = "Rolls Royce";
Page 26
break;
}
if (selectedCar.model.empty()) {
return;
}
int rentalDays;
cout << endl;
cout << "Enter The Number Of Rental Days: ";
cin >> rentalDays;
// int num=0;
// ifstream i("rental_history.txt");
// ofstream o("temp_rental_history.txt");
// while(getline(i,l1)){
// if(l1!="Rental Bill:"){
// continue;
// }
// getline(i,l2);
// getline(i,l3);
Page 28
// getline(i,l4);
// getline(i,l5);
// getline(i,l6);
// getline(i,l7);
// getline(i,l8);
// getline(i,l9);
// if(l2 == "Customer Name: "+user.name){
// if(num==choice-1){
// }
// else{
//
o<<l1<<endl<<l2<<endl<<l3<<endl<<l4<<endl<<l5<<endl<<l6<<endl<<l7<<endl<<l8<<e
ndl<<l9<<endl;
// }
// num++;
// }
// }
// i.close();
// o.close();
// remove("rental_history.txt");
// rename("temp_rental_history.txt", "rental_history.txt");
// }
// }
Page 29
while (getline(rent, l1)) {
if (l1 != "Rental Bill:") {
continue;
}
getline(rent, l2);
getline(rent, l3);
getline(rent, l4);
getline(rent, l5);
getline(rent, l6);
getline(rent, l7);
getline(rent, l8);
getline(rent, l9);
if (l2 == "Customer Name: " + user.name) {
cout << no + 1 << ".";
cout << l4 << " | " << l5 << "\n";
bill[no] = l1 + "\n" + l2 + "\n" + l3 + "\n" + l4 + "\n" + l5 + "\n" + l6 + "\n" + l7 + "\n"
+ l8 + "\n" + l9 + "\n";
no++;
}
}
cout << "choice = ";
cin >> choice;
cout << bill[choice - 1];
rent.close();
{
int num = 0;
ifstream i("rental_history.txt");
ofstream o("temp_rental_history.txt");
while (getline(i, l1)) {
if (l1 != "Rental Bill:") {
o << l1 << endl;
continue;
Page 30
}
getline(i, l2);
getline(i, l3);
getline(i, l4);
getline(i, l5);
getline(i, l6);
getline(i, l7);
getline(i, l8);
getline(i, l9);
if (l2 == "Customer Name: " + user.name) {
if (num == choice - 1) {
} else {
o << l2 << endl << l3 << endl << l4 << endl << l5 << endl << l6 << endl << l7
<< endl << l8 << endl << l9 << endl;
}
num++;
}
}
i.close();
o.close();
remove("rental_history.txt");
rename("temp_rental_history.txt", "rental_history.txt");
}
}
Page 31
cout << " Number of days: " << rental.rentalDays << endl;
cout << " Total cost: $" << fixed << setprecision(2) << rental.totalCost << endl;
cout << "****************************************Thank You For Choosing "<<
rental.car.company << "***************************************" << endl;
Page 32
Car("Hyundai", "Aura", 60.0, "Red"),
Car("Hyundai", "i10", 40.0, "Silver"),
Car("BMW", "3 series", 120.0, "Black"),
Car("BMW", "X5", 150.0, "White"),
Car("BMW", "X1", 110.0, "Gray"),
Car("Rolls Royce", "Phantom", 500.0, "Black"),
Car("Rolls Royce", "Ghost", 450.0, "Silver"),
Car("Rolls Royce", "Corniche", 550.0, "Red")
};
if (!authenticateUser()) {
cout<<endl;
cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Authentication Failed. Exiting.!!!!!!!!!!!!!!!!!!!!!!" <<
endl<<endl;
return 1;
}
while (true) {
cout << "\n----------------->Menu------------:" << endl<<endl;
cout << " 1. Rent a Car" << endl;
cout << " 2. Return a Car" << endl;
cout << " 3. Exit" << endl<<endl;
int choice;
cout << "Enter Your Choice (1-3): ";
cin >> choice;
cout<<endl;
switch (choice) {
case 1:
rentCar(user, cars, numCars);
Page 33
break;
case 2:
returnCar(user, cars, numCars);
break;
case 3:
exit(0);
default:
cout << "!!!!!!!!!!!!!!!!!!!!!!!!!Invalid Choice. Please select a valid
option.!!!!!!!!!!!!!!!!!!" << endl;
}
}
return 0;
}
Page 34
REFERENCES
2. https://www.javatpoint.com/student-data-management-in-cpp
3. https://www.geeksforgeeks.org/file-handling-c-classes/
4. https://youtu.be/QmuFxsixz60?feature=shared
5. STACK OVERFLOW
Page 35