Sie sind auf Seite 1von 30

Informatics Institute

of Technology
Department of computing

Car Pool Reservation

Module Leader: Mr.Guganathan Poravi


Student First name : Geerthana
Student last name : Bhasgaran
Student No

: 2014225

Date of submission :7/17/2015

Content
Introduction ..04
Analysis
I. Functional Requirements .......................05
II. Non-functional Requirements 06
Designing
I. Use case diagram 07
II. Activity diagram for functional requirement 08
III. Class diagram 14
Implementation
I. User login ..15
II. Add member (some as the add employee and vehicle) 16
III. Search member (some as the employee) ..17
IV. View vehicle 18
V. Reservation .18
Screenshots . 19
Evaluation
I. Black box Testing 26
II. White box Testing . 29

List of figures
1. Figure 1.1 use case diagram Figure 07
2. Figure 2.1 activity diagram for login figure . 08
3. Figure 2.2 activity diagram for reserve a vehicle figure 09
4. Figure 2.3 activity diagram for vehicle registration figure .10
5. Figure 2.4 activity diagram for rent registration figure ..11
6. Figure 2.5 activity diagram for search vehicle figure 12
7. Figure 2.6 activity diagram for update vehicle figure ...13
8. Figure 3.1 class diagram figure 14
9. Figure 4.1 Screen shot for Main menu(Login page) .19
10. Figure 4.2 Screen shot for add member Page ..20
11. Figure 4.3 Screen shot for add vehicle ..21
12. Figure 4.4 Screen shot for view vehicle page 22
13. Figure 4.5 Screen shot for Reservation page ... 23
14. Figure 4.6 Screen shot for view reservation . 24

Introduction
This system is developed for reserve the vehicle for Car Pool Reservation firm which
located in the Colombo. And it covers Western Province of Sri Lanka, works as the
meeting point to the people who willing to share their vehicle to work and home.
Main features of this system are to reserve the car for the people who need, and view
the details of the reservation. Functionality of this system is adding vehicle by the
owner, reserve the vehicle, add employee details, add member details, search customer
details, view vehicle details, view driver details etc. Purpose of this system is to make
automation of the Car Pool Reservation systems functionality.

Analysis
Functional Requirements
Reservation
1. The System must allow the customer to register for reservation.
2. The system shall allow the customer to view detail description of vehicle, driver,
and reservation.
3. The system must view list of available vehicles during reservation
4. The system shall allow the employee and customer to view reservations made by
customers.
5. The system must be able to provide a unique reservation conformation number
for all successful committed reservations.
6. The system must be able to display reservation summary for successfully
committed reservation.

Login
1. The system should allow staff and customers login to the system using their
username and password.
2. The system should allow staff to login to the system using their username and
password and also already register customers are using their username and
password.
3. The system shall allow the members reserve the vehicle and change member
details.
4. The system shall allow the change vehicle details and employee details.

Vehicle
1. The system should allow staff and customers(vehicle owner) register new
vehicles.
2. The system shall allow staff and customers to select vehicles.
3. Adding details of a vehicles
o Vehicle no
o Vehicle name
o Vehicle model
o Carrying capacity
o Engine capacity
o Colour of vehicle

Some as the member , employee and driver.


Adding details of member
o
o
o
o
o
o
o

Member ID
Name
Username
Password
Email
Telephone no
Address

Adding details of driver


o
o
o
o
o
o
o

Employee id
Name
Username
Password
Email
Telephone
Address

Non Functional Requirements


1.
2.
3.
4.

Extensibility
Maintainability
Efficiency
Accessibility

Designing

User case diagram


Car Pool Reservation
System
Login

Vehicle
Registration

Reserve vehicle

Search Vehicle

Update vehicle

View Vehicle
Admin

Member

Update Rent
View Reservation
Driver
Registration

Update driver

View Driver

Employee
Registration

Update Employee

Rent Registration

Logout
Figure 1.1 use
case diagram Figure

Analysis Model

Activity diagram
Activity diagram - login

Login

Enters Username & Password

Checks Username, Password


If input is
invalid

If input is
valid

Logged in to System

Figure 2.1 activity diagram for login figure

Activity diagram Reserve a vehicle

RegistrationRese
rve Vehicle
informationCustomers Enter
information
StatusName, ID, Phone Number, Vehicle No,
Date

input is
Empty

input is not
Empty

vehicleCheck
vehicle

Available

not
Available

SuccessReserv
ation Success

detailShow
confirmation Number

Figure 2.2 activity diagram for reserve a vehicle figure

Activity diagram - vehicle registration

Vehicle Registration

Customers or Employees
Enter vehicle information

Plate No, Model, Type, Engine Capacity, Insurance date,


Insurance Exp-date
If input is
Empty

If input is
not Empty

Check Plate No

If
Available

If not
Available

Vehicle Registered Success

Figure 2.3 activity diagram for vehicle registration figure

10

Activity diagram Rent registration

Rent

Customers Enter

Customer Information, Vehicle, Payment,

If input is
EmptyIf

If input is
not EmptyIf

Check

If
AvailableIf

If not
AvailableIf

Rent

Show rent

Figure 2.4 activity diagram for rent registration figure

11

Activity diagram Search vehicle

Vehicle Registration

Customers or Employees
selects

Select Plate No

If Not Selected or
Invalid Plate No

If Selected or
Valid Plate No

Searches from Database

Displays Vehicle

Figure 2.5 activity diagram for search vehicle figure

12

Activity diagram update vehicle

Enter Plate No

Customers or Employees
Enter vehicle information

If Valid

If Invalid

Enter Update information

Check Validation

If Valid

If Invalid

Update Vehicle

Figure 2.6 activity diagram for update vehicle figure

13

Class Diagram
1..*

Person

Vehicle

ID: String
Name: String
Username: String
Password: String
E-mail: String
Address: String
Phone Number: Integer

Plate Number : String


Vehicle Model : String
Vehicle Type : String
Engine Capacity : String
Insurance Date : DateTime
Insurance expDate : DateTime

getName() : void
getUsername () : void
getPassword() : void
getE-mail() : void
getAddress() : void
getPhoneNo(): void
setName() : void
setUsername () : void
setPassword() : void
setE-mail() : void
setAddress() : void
setPhoneNo(): void

1..*

RegisterVehicle()
UpDateVehicle()

1..*

Member

Employee

Member ID: String

Employee ID: String

setMemberID () : Void
registeredMember()
viewVehicle()
viewDriverDetail()
rentVehicle ()
reserverVehicle()

setEmployeeID () : Void
viewVehicle()
viewReserverVehicleDetail()
viewDriverDetail()
rentVehicle ()
reserverVehicle()
UpdateVehicle()
ViewEmployeeDetail()
UpdateEmployeeDetail()

Reservation
Plate Number : String
To: String
From: String
reserveVehicle()
viewreserve()

1..*

VehicleOwner
RegisteredVehicle()

Driver
Licence No :String
Age : Date
1

14

Implementation
User Login
public void showData(){
String str1 = usernametxt.getText();
char[] p = passwordtxt.getpassword();
String str2 = new String (p);
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con;
con =
(Connection)DriverManager.getConnection("jdbc:mysql://localhost/car","root" ,
"root");
PreparedStatement ps = con.prepareStatement("select name from
employee where UserName =? and Password =?");
ps.setString(1, str1);
ps.setString(2, str2);
ResultSet rs = ps.executeQuery();
if(rs.next()){
JOptionPane.showMessageDialog(null,"Login successfully
! ...");
}else{
JOptionPane.showMessageDialog(null, "Incorrect username or
password .. Try Again with correct detail");
}
}
catch (Exception ex){
System.out.println(ex);
}
}
public void showDatamember(){
String str1 = usernametxt.getText();
char[] p = passwordtxt.getpassword();
String str2 = new String (p);
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con;
con =
(Connection)DriverManager.getConnection("jdbc:mysql://localhost/car","root" ,
"root");
PreparedStatement ps = con.prepareStatement("select name from
member where UserName =? and Password =?");
ps.setString(1, str1);
ps.setString(2, str2);
ResultSet rs = ps.executeQuery();
if(rs.next()){
JOptionPane.showMessageDialog(null,"Login successfully
! ...");
}else{
JOptionPane.showMessageDialog(null, "Incorrect username or
password .. Try Again with correct detail");
}
}
catch (Exception ex){

15

System.out.println(ex);
}
}

Add Member
public static int addMember(Members m)throws ClassNotFountException, SQlException{
Connection con = ConnectionDB();
String quary = "INSERT INTO member values('"+ m.getMemberId() +
"','" + m.getMemberName() + "','" + m.getUsername() + "','" + m.Password() + "','"
+ m.getEmail() + "','" + Integer.parseInt(m.getPhoneNo())+ "')" ;
int res = DBHandler.setData(con, quary);
return res;
}
private void addBtnActionPerformer(java.awt.event.ActionEvent evt){
if(!memberIdTxt.getText().isEmpty() &&!mbnametxt.getText().isEmpty()
&&!mbusernametxt.getText().isEmpty()
&&!mbpasswordtxt.getText().isEmpty()
&&!mbMobileNoTxt.getText().isEmpty() &&!mbEmailtxt.getText().isEmpty() &&
!addressTxtArea.getText().isEmpty()){
String memberId = memberIdTxt.getText();
String memberName = mbnametxt.getText();
String memberUserName = mbusernametxt.getText();
String memberPassword = mbpasswordtxt.getText();
String teleNo = mbMobileNoTxt.getText();
String email = mbEmailtxt.getText();
String address = addressTxtArea.getText();
Members m = new Members(memberId, memberName, memberUserName,
memberPassword, teleNo , email, address);
try{
int i = memberController.addMember(m);
if(i == 1){
memberIdTxt.setText("");
mbnametxt.setText("");
mbusernametxt.setText("");
mbpasswordtxt.setText("");
mbMobileNoTxt.setText("");
mbEmailtxt.setText("");
addressTxtArea.setText("");
JOptionPane.showMessageDialog(rootPane, "Added
Successfully :)!");
}
}
catch(ClassNotFoundException | SQLException ex ){
Logger.getLogger(Memberview.class.getName()).log(Level.SEVERE,null, ex);
}
nextIDgenForMember();
}else{
JOptionPane.showMessageDialog(rootPane, "Please fill all
fields !");
}
}

16

Search Member
public void actionPerformed(ActionEvent e){
try{
String str = tf5.getText();
Class.forName("com.mysql.jdbc.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/CW3","root" , "root");
PerpareStatement st = con.prepareStatement("Select* from
member where MemberId = ? ");
st.setString (1, str);
ResultSet rs = st.executeQuery();
if(rs.next()){
String
String
String
String

s = rs.getNString(1);
s1 = rs.getNString(2);
s2 = rs.getNString(3);
s3 = rs.getNString(4);

tf1.setText(s);
tf2.setText(s1);
tf3.setText(s2);
tf4.setText(s3);
}
else{
JOptionPane.showMessageDialog(null, "Membeer ID is not
found ");
}
catch(Exception ex){
System.out.println(ex);
}
}

17

View vehicle
public void getToDetailsTable(){
newOrderDetailsTable.setRowCount(0);
try{
ArrayList al = new ArrayList();
al = vehicleController.viewAllvehicle();
for(int i = 0 ; i<al.size(); i++){
Vehicles v = new Vehicles();
v = (Vehicles) al.get(i);
Object ob[] = new Object[] {v.getNoPlate(),
v.getVehicleName(), v.getVehicleVersion(), v.getCarryingCapacity,
v.getEnginCapacity()};
newOrderDetailsTable.addRow(ob);
}
catch(ClassNotFoundException ex){
Logger.getLogger(ReservationView.class.getName()).log(Level.SEVERE,null,ex)
;
} catch(SQLException ex){
Logger.getLogger(ReservationView.class.getName()).log(Level.SEVERE,null,
ex);
}
}

Reservation
public static int reserveCar(CarPoolReservationRequirement cpr) throws
ClassNotFoundException , SQLException{
Connection con = ConnectorDB.getDBConnectiontoDB();
String quary = "INSERT INTO reservationCar values ('" +
cpr.getBookingID() + "','" + cpr.getVehicleID() + "','"+ cpr.getMemberId()+
"','" + cpr.getPaymentId() +"','"+
cpr.getDiscountPercent() + "','" + cpr.getFinalReservationCharge() +
"','"+cpr.getPaymentId() + "','"+
cpr.getTo() + "','"+ cpr.getFrom()
+"','"+cpr.getNumberRequired()+"')";
int res = DBHandler.setData(con, quary);
return res;
}

18

Screen shot
Login Page (Main menu)

Figure 4.1 Screen shot for Main menu(Login page)

19

Add Member

Figure 4.2 Screen shot for add member Page

20

Add Vehicle

Figure 4.3 Screen shot for add vehicle

21

View Vehicle

Figure 4.4 Screen shot for view vehicle page

22

Payment

23

Figure 4.5 Screen shot for Reservation page

24

View Reservation

Figure 4.6 Screen shot for view reservation

25

Evaluation
Black-Box Testing

Add a new Members


No

Input

Expect
Output

Actual
Output

Bug?

Member Name :
John
Member Name :
1234
Username : John

Stores the
member name
Invalid

No

No

Stores the
member
password
Password : 1234 Stores the
member
password
Email :
Stores the
John@gmail.com member email
Email : 1434234 Invalid

Email : jijdjfgfh

Invalid

10

Phone No :
0777234645

11

Phone No :
gjskjeod
Address :
Colombo

Stores the
member phone
no
Invalid

Stores the
member name
Stores the
member name
Stores the
member
username
Stores the
member
username
Stores the
member
password
Stores the
member
password
Stores the
member email
Stores the
member email
Stores the
member email
Stores the
member phone
no
Invalid

Stores the
member
address
Stores the
member
address

Stores the
member
address
Stores the
member
address

2
3
4

Username :
1234

Password: john

6
7

12
13

Address :
2453435

Stores the
member
username
Invalid

Yes
No
yes
No
No
No
yes
yes
No
No

No

26

Add a new employee

No

Input

Employee Name
: John
Employee Name
: 1234
Username : John

2
3
4
5
6
7
8
9
10
11
12
13

Expect
Output

Actual
Output

Stores the
Stores the
employee name employee name
Invalid
Stores the
employee name
Stores the
Stores the
employee
employee
username
username
Username :
Invalid
Stores the
1234
employee
username
Password: john
Stores the
Stores the
employee
employee
password
password
Password : 1234 Stores the
Stores the
employee
employee
password
password
Email :
Stores the
Stores the
John@gmail.com employee email employee email
Email : 1434234 Invalid
Stores the
employee email
Email : jijdjfgfh
Invalid
Stores the
employee email
Phone No :
Stores the
Stores the
0777234645
employee
employee
phone no
phone no
Phone No :
Invalid
Invalid
gjskjeod
Address :
Stores the
Stores the
Colombo
employee
employee
address
address
Address :
Stores the
Stores the
2453435
employee
employee
address
address

Bug?
No
Yes
No
yes
No
No
No
yes
yes
No
No
No
No

27

Add a new vehicle

No

Input

Expect
Output

Actual
Output

Bug?

Vehicle no :
01234
Vehicle No :
sdk2334
Vehicle name :
Jamaha
Vehicle name :
1234
Carrying
capacity : 7409

Stores the
vehicle no
Stores the
vehicle no
Stores the
vehicle name
Invalid

Stores the
vehicle no
Stores the
vehicle no
Stores the
vehicle name
Stores the
vehicle name
Stores the
carrying
capacity
Stores the
carrying
capacity
Stores the
engine capacity
Stores the
engine capacity
Stores the
colour
Stores the
colour

No

2
3
4
5
6

Carrying
capacity : jasdja

Engine capacity
: 8402
Engine capacity
: hjlkdjkjj
Colour : red

10

Colour : 990-39

Stores the
carrying
capacity
Invalid
Stores the
engine capacity
Invalid
Stores the
colour
Invalid

No
No
yes
No
yes
No
yes
No
yes

Reservation

No

Input

Expect
Output

Actual
Output

Bug?

From :
Colombo
From : 344545
To : Colombo
To : 398940
Distance: 3454
Distance:
fdjkljfk
Per (Km): 3454
Per (Km): sdoe

Stores the from

Stores the from

No

Invalid
Stores the to
Invalid
valid
Invalid

Stores the from


Stores the to
Stores the to
valid
Invalid

yes
No
yes
No
No

valid
Invalid

valid
Invalid

No
No

2
3
4
5
6
7
8

28

White-Box Testing
No

Condition

Add more customer

Edit customer

Search customer

Add more vehicle

Edit vehicle

View vehicle

Add driver

View driver

Path
Yes calls the register
customer page
No return back to the main
menu
Yes calls the register
customer page
No return back to the main
menu
Yes calls the register
customer page
No return back to the main
menu.
Yes Calls the register vehicle
page
No return back to the main
menu
Yes call the register vehicle
page
No return back to the main
menu
Yes call view vehicle page
No return back to the main
menu
Yes call register to the
vehicle page
No return back to the main
menu.
Yes call view driver page
No return back to the main
menu

Conclusion

This system is developed in Java base to automate the functionality of the Car Pool
reservation. Reservation, adding details, update are special features developed here to
fulfil the need of the firm. This system provide more easier, reduce the wastage of time
of the firms work, maintain standard database and change manual system in to
automatic.

29

30

Das könnte Ihnen auch gefallen