Hello faaDoOOO.. i need a project topic name " Online Car rental System " in Java language.
Thx in advance
Sponsored Ads
Hello faaDoOOO.. i need a project topic name " Online Car rental System " in Java language.
Thx in advance
Sponsored Ads
Hi @sujeet_feb , this is what you need:
Java application regarding car renting, booking and checking the availability of vehicles. For this application we have stored some model names, their registration no, rent rate on the basis of per day, and the amount to deposit in the arraylist. Now, a user is allowed to enter the model name to rent. If model is available, a message will get appeared and asks the no of days for rent. After that, it will display details on Deposit,Daily Rate, and Total Cost and asks the user whether he/she want to proceed or not. If user wants to proceeds, user is allowed to enter name and IC no. After that, the receipt will get displayed including all the details.
HERE IS THE CODE:
import java.util.*;
classCar
{
privateString make;
privateString model;
privateString regNo;
privateint deposit;
privateint rate;
publicCar(String newMake,String newModel,String newRegNo,
int newDeposit,int newRate)
{
make = newMake;
model = newModel;
regNo = newRegNo;
deposit = newDeposit;
rate = newRate;
}
publicString getMake()
{
return make;
}
publicString getModel()
{
return model;
}
publicString getRegNo()
{
return regNo;
}
publicint getDeposit()
{
return deposit;
}
publicint getRate()
{
return rate;
}
}
publicclassTestProject
{
publicstaticvoid main(String args[])
{
List carlist =newArrayList();
carlist.add(newCar("Toyota","Altis","SJC2456X",100,60));
carlist.add(newCar("Toyota","Vios","SJG9523B",100,50));
carlist.add(newCar("Nissan","Latio","SJB7412B",100,50));
carlist.add(newCar("Murano","SJC8761M","Nissan",300,150));
carlist.add(newCar("Honda","Jazz","SJB4875N",100,60));
carlist.add(newCar("Honda","Civic","SJD73269C",120,70));
carlist.add(newCar("Honda","Stream","SJL5169J",120,70));
carlist.add(newCar("Honda","Odyssey","SJB3468E",200,150));
carlist.add(newCar("Subaru","WRX","SJB8234L",300,200));
carlist.add(newCar("Subaru","Imprezza","SJE8234K",150,80));
Scanner input =newScanner(System.in);
System.out.print("Enter model to rent: ");
String model = input.nextLine();
for(Car s : carlist)
{
if(model.equals(s.getModel()))
{
System.out.println("Model "+ model +" is available");
System.out.print("Enter number of days: ");
int days = input.nextInt();
System.out.println("***************Details*****************");
int cost =(days * s.getRate())+ s.getDeposit();
System.out.println("Deposit DailyRate Duration TotalCost");
System.out.println(s.getDeposit()+" "+ s.getRate()+" "+ days +" "+ cost);
System.out.print("Proceed to rent?( y/n ): ");
String dec = input.next();
if(dec.equals("y"))
{
System.out.println("Enter Customer Name: ");
String name = input.next();
System.out.println("Enter IC Number: ");
int num = input.nextInt();
System.out.println("************Receipt*************");
System.out.println("Name ICNo Car RegNo Duration TCost");
System.out.println(name +" "+ num +" "+ model
+" "+ s.getRegNo()+" "+ days +" "+cost);
System.out.println("Serving Next Customer ");
}elseif(dec.equals("n"))
{
System.out.println("Serving Next Customer: ");
}
}
}
}
}
OUTPUT:
Enter model to rent: Altis
Model Altis is available
Enter number of days: 2
***************Details***************
Deposit DailyRate Duration TotalCost
100 60 2220
Proceed to rent?( y/n ): y
Enter Customer Name:
FaadooEngineer
Enter IC Number:
1111
********************Receipt******************
Name ICNo Car RegNo Duration TCost
FaadooEngineer 1111 Altis SJC2345X 2 220
Serving Next Customer
Last edited by koolkroocer; 27th July 2012 at 12:10 PM.
hasijahimanshu (17th February 2013), navnidheendra (2nd August 2012)
Thx Koolkroocer for ur reply...... but I need this project with interface & database.
If you are able to find my requirement then plz reply me ASAP
Thx one again![]()