0% found this document useful (0 votes)
22 views35 pages

Itfilenew

Uploaded by

gangster2003123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views35 pages

Itfilenew

Uploaded by

gangster2003123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Project Report on

CAR RENTAL MANAGEMENT SYSTEM


Submitted in the partial fulfillment of the requirement for the award of degree of

Bachelor of Technology in

Computer Science & Engineering


Batch
(2022-2026)

SUBMITTED TO SUBMITTED BY

Er. Veenum Mam Deepak (2233595)

(Assistant Professor) Kanwaldeep Singh (2233626)

Gurjot Singh (2233608)

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


AMRITSAR GROUP OF COLLEGES

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:

1. Deepak (ID: 2233595)

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.

2. Kanwaldeep Singh (ID: 2233626)

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.

3.Gurjot Singh (ID: 2233608)

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 Report, we will be always indebted to them.

This project completion has indeed helped us explore more knowledge avenues related to

C++ language and we are sure it will help us in future too.


DECLARATION

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).

Submitted To: Submitted By:

Er. Veenum Devi Kanwaldeep Singh (2233626)


(Assistant Professor) Deepak (2233595)
Gurjot Singh (2233608)
TABLE OF CONTENT

S. No. Content Page No.

1. Introduction To C++ 6-9

2. Introduction To Project 10-11

3. Scope Of Project 11

4. Objectives Of Project 12

5. Methodology 13-14

6. Hardware And Software Requirements 15

7. Tools Used 15

8. Results And Discussion 16-20

9. Appendix 21-34

10. References Used 35


INTRODUCTION TO C++

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++
---

Introduction to C++ Programming

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.

3. Standard Template Library (STL)

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.

6. Extensive Community and Ecosystem

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

C++ is used in a wide range of applications:

*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.

*High-Performance Computing:* C++ is essential in scientific computing, simulations, and applications


requiring significant computational power.

*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.

10. Exception Handling


C++ provides a robust exception handling mechanism, allowing you to write code that gracefully handles
errors and exceptions.
C++ is a versatile and powerful language, but it requires careful consideration of design choices and practices
to write efficient and reliable software.

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:

- *User Authentication:* The project starts with a robust user


authentication system. Users are required to provide a valid username and
password to access the system, ensuring that only authorized individuals can
rent cars. - * Password Masking: To safeguard user privacy, the password
input is masked, preventing unauthorized access or viewing.

- *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

The project is guided by three primary objectives:

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

1.User authentication credentials are read from `user.txt`.

2.Users select a car, and the rental cost is calculated.

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.

2.`User`: Stores user data, including name and contact information.

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.

• Processor : 1 GHz Software Requirements:-

• Operating system : Windows 7,8,10,11

• Compiler : The program can be compiled and executed with a C++ compiler, such as:

• 1. MinGW (Minimalist GNU for Windows)

2. Any other C++ compiler that supports conio.h library.

# C++ Compiler and System Information

• C++ Compiler: gcc (MinGW.org GCC-6.3.0-1) 6.3.0


• System Information: Windows 11
• Code Editor : Vscode

TOOLS USED

# File Handling Packages->

- Input and output operations are performed using the standard C++ `` library.

- Password masking is achieved using the `` library.

- String Files used by the program.

- 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;

Car(string company, string model, double price, string color)


: company(company), model(model), price(price), color(color), rentedBy("") {}

bool isRented() const {


return !rentedBy.empty();
}

void rent(const string& username) {


rentedBy = username;
}

void returnCar() {
rentedBy = "";
Page 21
}
};

class User {
public:
string name;
string contact;

User(string name, string contact) : name(name), contact(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) {}
};

void generateBill(const Rental& rental);


User getUserData();
bool authenticateUser();
Car selectCar(Car cars[], int numCars, string companyName);
double calculateRentalCost(const Car& car, int days);
void rentCar(User& user, Car cars[], int numCars);
void returnCar(User& user, Car cars[], int numCars);
Page 22
User getUserData() {
User user("", "");
cout << endl;
cout << "Enter Your Name: ";
cin.ignore();
getline(cin, user.name);
cout << "Enter Your Contact Information: ";
getline(cin, user.contact);
return user;
}

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();

if (username == storedUsername && password == storedPassword) {


cout << endl;
cout << "<------------------------------Authentication Successful. Welcome, " <<
username << "!------------------------------------>" << endl;
return true;
} else {
cout << endl;
cout << "<------------------------------Authentication Failed. Incorrect username or
password.----------------------->" << endl;
return false;
}
} else {
cout << "User file not found." << endl;
return false;
}
}

Car selectCar(Car cars[], int numCars, string companyName) {


int choice;
cout << endl;
cout << "************************************Available Models For " <<
companyName << ":**********************************************" << endl;
cout<<endl;
bool noAvailableCars = true;

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;

if (choice < 1 || choice > numCars) {


cout << "<-----------------!!!!!!!!Invalid choice. Please Select a Valid Option--------------
>." << endl;
return Car("", "", 0.0, "");
}

return cars[choice - 1];


}

double calculateRentalCost(const Car& car, int days) {


return car.price * days;
}

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 < 1 || choice > 4) {


cout << "*************************!!!!Invalid choice. Please select a valid
option.**********************" << endl;
return;
}

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;
}

Car selectedCar = selectCar(cars, numCars, companyName);

if (selectedCar.model.empty()) {
return;
}

int rentalDays;
cout << endl;
cout << "Enter The Number Of Rental Days: ";
cin >> rentalDays;

double totalCost = calculateRentalCost(selectedCar, rentalDays);


selectedCar.rent(user.name);

Rental rental(user, selectedCar, rentalDays, totalCost);


generateBill(rental);
}

// void returnCar(User& user, Car cars[], int numCars) {


// ifstream rent("rental_history.txt");
// string s;
// string bill[10];
// int choice;
// int no=0;
// string l1,l2,l3,l4,l5,l6,l7,l8,l9;
// while(getline(rent,l1)){
// if(l1!="Rental Bill:"){
// continue;
Page 27
// }
// 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:"){
// 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");
// }
// }

// Function to return a rented car


void returnCar(User& user, Car cars[], int numCars) {
ifstream rent("rental_history.txt");
string s;
string bill[10];
int choice;
int no = 0;
string l1, l2, l3, l4, l5, l6, l7, l8, l9;

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");
}
}

void generateBill(const Rental& rental) {


cout << "\n****************** Rental Bill******************" << endl<<endl;
cout <<" Customer Name: "<< rental.user.name << endl;
cout << " Contact Information:" << rental.user.contact << endl;
cout << " Company: " << rental.car.company << endl;
cout << " Model: " << rental.car.model << endl;
cout << " Price per day: $" << fixed << setprecision(2) << rental.car.price << endl;

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;

ofstream outFile("rental_history.txt", ios::app);


if (outFile.is_open()) {
outFile << "\nRental Bill:" << endl;
outFile << "Customer Name: " << rental.user.name << endl;
outFile << "Contact Information: " << rental.user.contact << endl;
outFile << "Company: " << rental.car.company << endl;
outFile << "Model: " << rental.car.model << endl;
outFile << "Price per day: $" << fixed << setprecision(2) << rental.car.price << endl;
outFile << "Number of days: " << rental.rentalDays << endl;
outFile << "Total cost: $" << fixed << setprecision(2) << rental.totalCost << endl;
outFile << "Car Returned Successfully......" << endl;
outFile << "-----------------------------------------------" << endl;
outFile.close();
} else {
cerr << "!!!!!!!!!!!!!!!!!!!!!!!Unable to open the file for writing!!!!!!!!!!!!!!!!!." << endl;
}
}
int main() {
system("cls");
cout << "\t\t\t|******************************************|\n";
cout << "\t\t\t| WELCOME TO DEEPAK CAR RENTAL SERVICE |" << endl;
cout << "\t\t\t|******************************************|\n\n";

const int numCars = 9;


Car cars[numCars] = {
Car("Hyundai", "Verna", 50.0, "Blue"),

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;
}

User user = getUserData();

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

1. You Tube:- CODE WITH HARRY

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

You might also like