Professional Documents
Culture Documents
Design and Implementation of Car Rental System
Design and Implementation of Car Rental System
CSUSB ScholarWorks
2001
Recommended Citation
Abdel-Jaber, Fadi Fayez, "Design and implementation of car rental system" (2001). Theses Digitization
Project. 1836.
https://scholarworks.lib.csusb.edu/etd-project/1836
This Project is brought to you for free and open access by the John M. Pfau Library at CSUSB ScholarWorks. It has
been accepted for inclusion in Theses Digitization Project by an authorized administrator of CSUSB ScholarWorks.
For more information, please contact scholarworks@csusb.edu.
DESIGN AND IMPLEMENTATION OF CAR RENTAL SYSTEM
A Project
Presented to the
Faculty of
San Bernardino
In Partial Fulfillment
Master of Science
in
Computer Science
by
December 2001
A Project
Presented to the
Faculty of
San Bernardino
by
December 2001
Approved by:
George M. Georgiou
Kerstin Voigt
© 2001 Fadi Fayez Abdel-Jaber
ABSTRACT
usually think twice about the company from which they want
will obtain.
Ill
ACKNOWLEDGMENTS
and Dr. Kerstin Voigt for ail their support and help
IV
TABLE OF CONTENTS
ABSTRACT iii
ACKNOWLEDGMENTS iv
LIST OF FIGURES xi
1.1 Introduction 1
1.2 Motivation 2
1.3 Scope 3
Rental Systems 4
DESIGN 7
Attributes 24
3.2.2 Normalization 27
Relation Model 40
IMPLEMENTATION
Functionality 46
vi
Design Process
71
5.4.4 Operation
72
6.2 Constraints
74
6.3 A
ssumptions and Dependencies
75
6.5
Transaction Testing Table
76
6.6 Conclusion
76
OF THE SYSTEM
78
REFERENCES
99
Vll
LIST OF TABLES
Attributes 28
Attributes 30
Attributes 30
Table Attributes 31
Attributes 31
Vlll
Attributes 31
Attributes 33
Attributes 33
Attributes 33
Attributes 37
Attributes 37
Attributes 38
Attributes 38
IX
Attributes 38
1 :
LIST OF FIGURES
Figure 2.1.
Enhanced Entity Relation Model of the
System 13
Figure 2.2.
Primary Key Representation 19
Figure 2.3.
Class Diagram of the System 20
Figure 3.1.
Normalized Entity Relation Model 40
Figure 5.1.
Forms Navigation Diagram 45
Figure 5.2.
Login Window 46
Figure 5.3.
Welcome Window 47
Figure 5.4.
Main Menu Window 48
Figure 5.5.
Individual Customer Choice Window 49
Figure 5.6.
Zip Code Tab Page Window 52
Figure 5.7.
Customer Tab Page Window 53
Figure 5.8.
Job and License Tab page Window 54
Figure 5.9.
Company Tab Page Window 56
Figure 5.10.
Car Window 57
Figure 5.11.
Rental Branches Window 58
Figure 5.12.
Rent Choice Window 59
Figure 5.13.
Customer Choice Window 60
Figure 5.14.
Individual Customer Rent a Car
Window 01
Figure 5.15.
Corporate Customer Rent A Car Window 62
Figure 5.16,
Receiving a Car Window 63
Figure 5.17,
New User Account Window 65
Figure 5.18
Contract Choice Window 66
Figure 5.19
Corporate Parameter Window 66
xi
XIX
if'- '
CHAPTER ONE
INTRODUCTION
I.l Introduction
service.
end users. The end users for this project could be anyone
that can read and write English. Also he/she should have
unauthorized users.
1.2 Motivation
future enhancements.
1.3 Scope
last.
possible.
the reports.
Rental Systems
face
some difficulties learning character-based
which all of them are important tools that have been used
in this project.
system.
CHAPTER TWO
CONCEPTUAL DESIGN
design model.
ensure that all user data requirements are met and that
Life Cycle
2. Conceptual Design.
software applications.
system format.
and validated.
User
Account Form'.
10
Model
11
number.
12
Type
Customer Type
Lie r^o
(1,N)
Job
License
(1:N
(1,N)
(1,N)
Customer
Co no
SSN
ndividual Corporate
Bran. No
RentNo
PlateN
M.N)
Retype
PlateNo
1,N]
Rent Type
Rent Detail
Car
Ins.Type o (1,N)
Price o
Flag
Car Status
13
and others.
master.
described below:
14
customer.
(.N) table.
more
rent transactions. On the other
15
locations.
type.
16
information.
relationships as follow:
17
car,
a customer may have more than one
customer.
or more jobs.
18
Security Number.
SS
19
attribute.
Job License
Cname {ck} Lice, no {ck}
XT
Customer
Type
Corporate D Non-Corporate
C
SSN {ck} SSN {ck}
Rent Vlaster
Status Rent no{ck}
Flag {ck}
CL
Car O-
Plate no {ck} Cl
Q Rent Detail
Rentno{ck1}
Plate no{ck2}
Rental Fee 00 0
Plate no {ck1}
Fee {ck2}
Rent Type Insurance
Type {ck} Type{ck}
Rental Brancti
Zip code{ck}
20
21
CHAPTER THREE
DATABASE DESIGN
Four
phases of the database design process can be
identified:
22
stages:
1. System-independent mapping.
Database Design
23
SSN Fname Ml Lname Address City State Zip code DOB Phone Type
SSN -► Lname
SSN —-► Mi
SSN —► Address
SSN —► State
SSN —► Phone
SSN -► Type
2.4
Table 3.2. Corporate Customer Table Attributes
CompanyNo -► Co name
GompanyNo -► Address
CompanyNo -► State
PlateNo -► Make
PlateNo -► Model
PlateNo -► Year
PlateNo -► Color
PlateNo -► Summery
PlateNo -► Flag
Co name ► Phone No
25
Table 3.5. License Table Attributes
RentNo SSN Rent Date Card No Card Type Card Expiration PlateNo Rent Branch No
RentNo SSN
RentNo Card No
RentNo PlateNo Branchno MileOut IVHeln GasOut GasPite Gas Ins. RentType MgtOsc. Other JcM
In Type charge
26
Table 3.8. .Rental Branches Table Attributes
BranchNo -► BName
BranchNo -► City
BranchNo -► State
BranchNo -► Tax
BranchNo -► Phone
3.2.2 Normalization
27
normal form called Boyce-Code normal form. All normal
attribute.
SSN Fname Ml LName Address City State Zip code DOB Ptione Type
28
(SSN) and place them in a new table (table 3.14). The new
SSN Fname Ml LName Address City State Zip code Dob Phone
29
normalization-related problem. It is a
follows:
SSN Fname Ml LName Address City State Zip code Dob Phone
1
30
Zip code is neither a candidate key nor part of the
it, which are city and state. The solution of the above
Attributes
SSN F. Name Ml L. Name Address City State Zip code Dob Phone
31
ComDanv No. Name Address City State Zip code Contact Person Contacted Person
Phone
it, which are city and state. The solution of the above
32
code in table company for referencing purposes. The new
Companv.No. Name Address Zip code Contact Person Contacted Person Phone
reason for that is a car may have more than one rental
33
the attributes.
Flag No Description
34
The above relation (table 3.29) is not in INF because
shown below:
CoName Address
SSN CoName
35
in 3rdNF.
RentNo SSN Rent Date CardNo Card Type Card Expiration PiateNo Rent Branch No
36
RentNo SSN Rent Date CardNo Card Type Card Expiration Rent Branch No
RentNo PiateNo De|*o MieOut M.ln GasOut GasPrioe Gas Ins. RenfType Disc ToH Balance
In Type
37
and 3rdNF.
needs to be normalized.
BranchNo BranchPhone
to 3rdNF as follows:
38
39
Type
Cust Zip
Lie no
(1.N) no
1 /\ 1
License
(1,N)
(1,N)
(1,N)
Job address
Customer
Cust Phone
Co no
SSN
C^^^^^code^
Non Corporate Corporate
B. Zip
Rental Branches
l.N
Rent Master
R. type
Plate no
P ate no
(1,N
Rent Type
Ins. type
^—<0
(1,N)
Price
,(S)
Ins. Type
40
CHAPTER FOUR
CHOICE OF DATABASE
MANAGEMENT SYSTEM
the DBMS for the task at hand. Issues to consider here are
must be considered:
2. Maintainance Cost.
Features
41
production environments.
techniques.
42
facilities.
libraries.
43
of the application.
easily.
44
CHAPTER FIVE
- DESIGN•AN D IMPLEMENTATION
Diagram .
Log In Form
We come Form
Mam Form
Rent a Car
Form
Individual
Customer Form
RentSub Customer
Corporate
Receive a Car
Customer Form
Form
Corporate Person
::45
user must enter the correct user name and password. After
three failed attempts the system will force the end user
Login Window
Username:
Password:!
Database:!
Connect Cancel
46
Date User
Fall 2001
the system.
47
User ^Datel
RENT CAR
Main Menu
CUSTOMER ADMINISTRATOR
RENTAL CONTRACTS
BRANCHES
QUIT
This window will ask the end user to choose the customer
48
Dste
O Individual Customer
Go Main Menu
O Corporate Customer
menu has three tab pages, the first one contains the zip
49
to be updateable items.
the proper record that the user asked to retrieve from the
database.
the first field and all the fields in the window will be
50
save the information that has been entered? >. After this,
insert mode, update mode and delete mode. The user will
51
Date
User
Enter Query
Execute Query
Insert Record
Update Record
State I I
Delete Record
Save
Return
52
Date
User!
Enter Query
SSN
Zip code
Execute Query
Name
Insert Record
Address
Update Record
DOB
Delete Record
Home Ptione
Save
Return
T
T
T
information.
53
wm
wm
Job title
Enter Query
Work Address
Insert Record
Update Record
License no
Delete Record
License type
Save
State issued
Return
Expire date
consists of two tab pages, one is * Zip code ' and ,the
the users,: can; query about re-cord, insert ' a- record, delete
54
and delete mode. The user will choose the mode, depending
the zip code page and company page. That means one or more
55
* *
Enter Query
Execute Query
Insert Record
Update Record
Delete Record
Save
:same, options all over the system windows. The use can
56
available for rent; 'l' means that the car is
Make Model
Execute Query
Year Color
Insert Record
Flag
Update Record
Automatic 4 Doors I |i
Delete Record SUV Convertible | |
Save
4x4 Minivan [ [
Return
Summery
only users' who .have access tO this window are the.. Database
proper privileges,from the DBA. .if the user does not have
57
the privileges for this window, the push button on the
Date User
Enter Query
Insert Record
State
□ Tax
Update Record
Branch No Name Address Phone
Delete Record
Save
Return
58
5.2.7 Rent Information Choice Window
all the cars in the system that have 'Flag' equal to zero
Datei User
59
will pop. up (figure 5.13) ., This window will ask the end
clicking on that button, the main menu window will pop up.
Date User
O Individual Customer
O Corporate Customer
60
File orms
Date . User
Enter Query
Rent information
Rent no I
execute Query
SSN I Name [
Expire date
Update Record
Car information
Delete Record
ake Model Year, , Color
Save
Return
61
1
■
■ SglSiaitii
RAntinfnrmalim
I Enter Query
',.4 -r: -'i-m..:- :'M.:(v^^::,./.:. -., .:-,> -;-,;„^a -o-;:- :'':isi\ '■. -• -'
i
Rent no I
Execute Query Com. No I Company name
I Branch no ( Credit Card No.
Insert Record Card type [ Rent date
Expire date [
Update Record
Delete Record
ill*
Save
H
Return ■
■
afrz;
r"Tr^2k
that the user needs when a client returns the rented car.
62
the users are limited to three rent types which are
Dae User
Rent information
Rent no I
SSN I Name
Enter Query
Dept No I Card No
Execute Query
Car information
Insert Record
- ■
! i
Update Record
■
5 Delete Record
Rent detailed information
Save DepteNo. Mile out Mile in Gas out Gasin Gasprice Gasctiarges Instype
Return
Tax Total
63
the case, the system will show the following message ('Re
enter User name and password again'). There are two push
Basically, the DBA will enter the information for the new
64
Date User
User Name
Password
Re Enter Password
jate
1
Cti
button. This window has two radio buttons options, one is.
to ask the user the contract type. This window has a date
and a user field, and both of them are located oh the fop
65
Date I User
O Individual Contract
O Corporate Conh-act
ReportParameters
Company Name
66
Date
Customer Information
Co No C Name I
Address II Contact person:
City C State Zip code I ]Phone i
Car Information
Rent Information
Customer Signature
67
Report Parameters
68
Date
Customer Information
SSN C Name C
Address C
Rent Information
Customer Signature
follows:
69
value.
forms and reports easy and quick. This menu moduie has six
70
system.
conversion.
Also the test will include the security and the privileges
that have been assigned by the DBA to each end user. This
71
phase of application life cycle will be the last phase
5.4.4 Operation
operation.
72
CHAPTER SIX
form.
. . 73
user account has full permission to do any kind
and query.
options.
6.2 Constraints
74
Dependencies
as shown below:
75
Transaction System
6.6 Conclusion
76
that Oracle form provides for each item, block and form
and asking them about problems that they face with current
77
APPENDIX A
Security Form
set_window_property(forms_mdi_window,window_state,maximize) // Maximize'the
current window
set_window_property('dept_win window_state',maximize);
then
else
begin
else
end if;'
end;
end if; ;
Welcome form
declare
variable
begin
:welcome,.cur_date:=sysdate;
:welcome.cur_user:=user;
end;
When_new_form_instance(Form level)
set_window_property('about',window_state,maximize);
declare
79
expires
Car form
When_new_form_instance(form level)
if x='r2' then
80
set_itein_property('control.exe_query' ^ enabled,property_true);
end if; ■
if x='r3' then
set_item_property('control.return enabled,property_true);
set_item_property('control.enter_query',enabled,property_true);
. set_item_property('control.exe_query',enabled,property_true);
end if; .
end loop;
end;
set_window_property(forms_mdi_window,window_state,maximize);
set_window_property('dept_win',window_state,maximize);
//This trigger will be fired in all forms //that has master details
relationships
-- begin default relation program section ■
begin
clear_all_master_details;
end;
declare
of
of
rel_id relation;
begin
return;
end if;
!1
end if;
end;
on_check_detail_master trigger
declare
dummy_define char(1);
begin
car_price_cur
82
car_price_cur
raise form_trigger_fallure;
end if;
close car_price_cur;
end;
Key_next_item(irem level)
Vertical Toolbar Codes //This tool bar are in most of the system forms
When_bottn_pressed('enter query' ,item level) //Trigger will be fired when the item
pressed
be in query mode
set_item_property('car.make',queryable,property_true);
set_item_property('car.model',queryable,property_true);
set_item_property('car.year',queryable,property_true);
set_item_property('car.colore queryable,property_true);
set_item_property('car.flag',queryable,property_true); .
set_item_property('car.summery',queryable,property_true);
set_item_property('car_price.daily_price',queryable,property_true);
enter_query;
When_bottn_pressed('execute query' ,item level) //Trigger will be fired when the
item
pressed
83
set_item_property('car.flag',queryable,property_false);
set_item_property('car.summery',queryable,property_false);
set_it0m_property('car_pric0.daily_pric0',queryable,property_false);
set_item_property('car.plate_no',update_allowed,property_false)';
set_item_property('car.make',update_allowed,property_false);
set_item_property('car.model',update_allowed,property_false);
set_item_property('car.year',update_allow0d,property_false);
set_item_property('car.colore',update_allowed,property_false);
set_item_property('car.flag',update_allowed,property_false);
set_item_property('car.summery',update_allowed,property_false);
,set item_property('car_price.daily_price',update_allowed,property_false);
for
set_item_property('car.make',insert_allowed,property_true);
set_item_property('car.model',insert._allowed,property_true);
set_item_property('car.year',insert_allowed,property_true);
set_item_property('car.colore',insert_allowed,property_true);
set_item_property('car.flag',insert_allowed,property_true);
set_item_property('car.summery',insert_allowed,property_true);
set_item_property('car_price.daily_price',insert_allowed,property_true);
enter_query;
set_item_property('control.save enabled,property_true);
set_item_property('control.return enabled,property_true);
set_item_property('control.insert_record',enabled/property_false);
set_item_property('car.plate_no',update_allowed,property_true);
set_item_property('car.make',update_allowed,property_true);
set_item_property('car.model',update_allowed,property_true);
set_item_property('car.year',update_allowed,property_true);
set_item_property('car.colore',update_allowed,property_true);
set_item_property('car.flag',update_allowed,property_true);
set_item_property('car.summery',update_allowed,property_true); ■
set_item_property('car_price.daily_price',update_allowed,property_true);
for •
set_item_prdperty('car,make',update_allowed,property_true);
set_item_property('car.model',update_allowed,property_true);
set_item_property('car.year',update_allowed,property_true)';
set_item_property('car.colore',update_allowed,property_true);■ .
set_item^property('car.flag',update_allowed,property_true) ,•
set_item_property('car.summery',update_allowed,property_true);
set_item_property('car_price.daily_price',update_allowed,property_true);
go_block('car_price');
■84
//build in word to go to the specified block
delete_record; . . - ,
set_item_property('control.save enabled,property_true);
set_item_property('controlireturn enabled,property_true);
set_item_property('control.delete_record',enabled,p.roperty_false);
set_item_property('control.save',enabled,property_false); ' ■ ■
//define the same cursor insert_role to return everything as default
declare
begin
open insert_role ; . //opening cursor insert_role
loop
end;
When_bottn_pressed('return'' ,item level)
Customer form
begin
Variable type
page
window
go_block('customer');
go_block('job');
go_block('company');
end if; :
end;
When_new_form_instance(form level)
current user
current
window
set_window_property('sub_menu',window_state,maximize);
declare
begin
rg:=create_group_from_query('gl','select descrip,to_char(cust_type) ,
from cust_type');
end;
the mouse
if :cust =1 //comparison
specific block
set_tab_page_property('customer.company',visible,property_false);
86
end if;
if :cust =2 . ■
go_block('zipcode_city');
set_tab_page_property('customer.job visible,property_false);
end if; ■
Pre_query(block level)
any value
■ character
Enter key
else
//message box
end if;
declare
variables
begin
return;
end if;
rel_id := find_relation('cust_type.cust_type_cust_join_type');
When_botton_pressed(item level)
When_botton_pressed(item level)
form
When_botton_pressed(item level)
When_botton_pressed(item level)
When_botton_pressed(item level)
When_botton_pressed(item level)
the forms
When_tab_page_changed(form level)
declare
variable
begin
type
if x=•zipcode'
end if; •
end;
When_mouse_click(item level)
if :rent'= 1; //comparison
then .
master
elsif :rent =2
then new_form('c:\project\rent_recieve.fmx') ;
form .
end if;
one
set flag=l
declare
m_name varchar2(1);
l_name varchar2(20);
begin
//SQL statement
from customer
where ssn=:ssn;
end;
When_validate_item(item level)
-- begin default
When_validate_item(item level)
declare
primary_duinmy char(1);
begin
//comparison
message('foreign key value does not currently exist in the primary key
close primary_cur;
end if;
end;
Post_change(item level)
from car
89
Post_change(item level)
into :ins_daily_price
from ins_type
where ins_type=:ins_type;
Post_change(item level)
from rent_type
Post_update(block level)
set flag=0
Post_change(item level)
from car_price
Post_change(item level) , .
from-dept_zipcode a,department b
■b.dept_no.= :return_dept_no;
Post_change ( item level)
if : gas_out_gallon - gas_in_gallon >0
//comparison
, then • ' '. ■
else
:gas_charge := 0; •
end if;
Post_change(item level)
into :ins_daily_price
from ins_type ■ , . , ,
where ins_type=:ins_type;
if :rent_type=l //comparison
then :ins_charge:=:rent_period*:ins_daily_price ;
elsif :rent_type=2 //comparison
90
then :ins_charge:=:rent_period*:ins_daily_price*30 ;
end if;
Post_change(item level)
into :rent_description
from rent_type
Key_next_item(item level)
select
item)
go_field('discount');
Key_next_item(item level)
nvl(;gas_charge,0) )
//SQL statement(calculated item)
((:cust_disc)+(:discount));
go_item('tot_paid');
Key_next_item(item level)
go_field('balanc');
91
APPENDIX B
IMPLEMENTATION OF SYSTEM
TABLES
92
,Flag_description varchar230),
Car Table
93
Cust_f_name varchar2 (15) not null,
Constraint fk_zip_codel2 foreign key (Zip code) references Customer_Zip code (Zip
code)).
Job Table
Constraint fk_zip_codel2 foreign key (Zip code) references Customer_Zip code (Zip
code)).
License Table
, 94
95
Constraint pk_rent_no primary key (R0nt_no,Plat0_no),
96
APPENDIX C
97
1: .1
One to. One Relationship
1: N
One to Many Relationships
N: M
Many to Many Relationships
DBMS
Database Management System
DDL
Data Definition Language
EER
Enhanced Entity Relation
GUI
Graphical User Interface
ODBC
Open Database Connection
OS
Operating system
PL/SQL
Procedural Language / Structured Query
Language
PK
Primary Key
SQL
Structured Query Language
98
REFERENCES
, California
19-99
.
1995.
[10] P
ioneer System, Pioneer Rent A Car Company, 1997.
99