0% found this document useful (0 votes)
7 views10 pages

Java Project 3

The 'Car Rental System' project is a Java application designed to streamline car rental operations for agencies and customers. It features functionalities for checking available cars, reserving and returning vehicles, and viewing rented cars, all through a user-friendly interface. The system automates tasks such as inventory management and booking, enhancing efficiency and customer satisfaction for rental businesses.

Uploaded by

Rahul Patil
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)
7 views10 pages

Java Project 3

The 'Car Rental System' project is a Java application designed to streamline car rental operations for agencies and customers. It features functionalities for checking available cars, reserving and returning vehicles, and viewing rented cars, all through a user-friendly interface. The system automates tasks such as inventory management and booking, enhancing efficiency and customer satisfaction for rental businesses.

Uploaded by

Rahul Patil
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

Visvesvaraya Technological University

Belagavi

BLDEA's V P Dr PG Halakatti College of


Engineering & Technology
VIJAYaPURA

Department of
Computer science & engineering
project report
On
“Car rental system”
(An application developed using Java)

Under the guidance of

Prof. Roopa Chavan

Presented by:
• Rahul Patil
CONTENTS
[Link] TITLE [Link]

1 Introduction 1

2 Instructions 2

3 Code segment 5-7

4 Output 8-9

5 Conclusion 10
INTRODUCTION

• The "Car Rental System" project is a software


application developed in Java that aims to provide a
convenient and efficient solution for managing car
rental operations.

• It serves as a platform for both car rental agencies


and customers, enabling them to interact and carry
out various tasks related to renting and managing
vehicles.

• This project caters to the needs of car rental


businesses by offering a centralized system to
streamline their operations.

• It provides a user-friendly interface for customers to


search, book, and manage car rentals, while also
offering administrative features for the rental agency
to manage their fleet, bookings, and other related
aspects

1
instructions

• Check Available Cars:


Select option 1 to view the available cars. The system will display
a list of cars that are currently available for rental.

• Reserve a Car:
Choose option 2 to reserve a car. The system will show the
available cars. Enter the car number you wish to reserve. Provide
the number of days for the rental. The system will calculate the
total rental cost and confirm the reservation.

• Return a Car:
Select option 3 to return a rented car. The system will display the
list of currently rented cars. Enter the car number you want to
return. The system will mark the car as available for rental.

• View Rented Cars:


Choose option 4 to display the list of currently rented cars. The
system will show the cars that are currently rented. Feel free to
contribute to the project, customize it, or enhance its
functionalities to meet your specific requirements. This project is
ideal for those who want to learn Java programming and gain
practical experience by building a car rental system.

2
CODE SEGMENT:

import [Link];

public class CarRentalSystem {


public static void main(String[] args) {
Scanner scanner = new Scanner([Link]);
String[] cars = {"Honda", "Toyota", "Ford"};
boolean[] availability = {true, true, true};
double[] prices = {50.0, 60.0, 55.0};

while (true) {
[Link]("Car Rental System");
[Link]("-----------------");
[Link]("1. Check available cars");
[Link]("2. Reserve a car");
[Link]("3. Return a car");
[Link]("4. Display rented cars");
[Link]("5. Exit");
[Link]("Enter your choice: ");
int choice = [Link]();

switch (choice) {
case 1:
[Link]("\nAvailable Cars:");
boolean allCarsUnavailable = true;
for (int i = 0; i < [Link]; i++) {
if (availability[i]) {
[Link]((i + 1) + ". " + cars[i]);
allCarsUnavailable = false;
}
} if (allCarsUnavailable) {
[Link]("No cars currently available.");
}
break;
case 2:
[Link]("\nAvailable Cars:");
boolean allCarsRented = true;
for (int i = 0; i < [Link]; i++) {

4
if (availability[i]) {
[Link]((i + 1) + ". " + cars[i]);
allCarsRented = false;
}
}
if (allCarsRented) {
[Link]("No cars currently available for rental.");
break;
}
[Link]("Enter the car number to reserve: ");
int carNumber = [Link]();
if (carNumber >= 1 && carNumber <= [Link] && availability[carNumber - 1])
{
[Link]("Enter the number of days for rental: ");
int numDays = [Link]();
double totalCost = prices[carNumber - 1] * numDays;
[Link]("Car reserved successfully!");
[Link]("Total rental cost: $" + totalCost);
availability[carNumber - 1] = false;
} else {
[Link]("Invalid car number or car is not available for rental.");
}
break;
case 3:
[Link]("\nRented Cars:");
boolean allCarsReturned = true;
for (int i = 0; i < [Link]; i++) {
if (!availability[i]) {
[Link]((i + 1) + ". " + cars[i]);
allCarsReturned = false;
}
}
if (allCarsReturned) {
[Link]("No cars currently rented.");
} else {
[Link]("Enter the car number to return: ");
int returnCarNumber = [Link](); if (returnCarNumber >= 1 &&
returnCarNumber <= [Link] && !availability[returnCarNumber - 1]) {
availability[returnCarNumber - 1] = true;
[Link]("Car returned successfully!");
} else {
[Link]("Invalid car number or car is already available.");
} 5
case 4:
[Link]("\nRented Cars:");
boolean noCarsRented = true;
for (int i = 0; i < [Link]; i++) {
if (!availability[i]) {
[Link](cars[i]);
noCarsRented = false;
}
}
if (noCarsRented) {
[Link]("No cars currently rented.");
}
break;
case 5:
[Link]("Exiting... Thank you!");
return;
default:
[Link]("Invalid choice. Please try again.");
break;
}
}
}
}

6
OUTPUT:
8
CONCLUSION

The "Car Rental System" project in Java aims to simplify


the car rental process by providing an efficient and user-
friendly platform for both rental agencies and customers.

It automates various tasks, such as vehicle inventory


management, booking, and payment processing, enhancing
the overall rental experience. By utilizing this system, car
rental agencies can optimize their operations, improve
customer satisfaction, and boost their business efficiency.

You might also like