Chapter-1 Implementation of Use Case Diagram 1.1 Description
Chapter-1 Implementation of Use Case Diagram 1.1 Description
1.1 DESCRIPTION
The Car Rental System is used by the intended user or the administrator.
1
Use Case Name: Generate Bill
Description: The Employee generates the bill when customer reserves a car.
1.2 FUNCTIONALITIES
GRAPHICAL NOTATION
The basic components of Use Case diagrams are the Actor, the Use Case, and The association.
ACTOR
An Actor, as mentioned, is a user of the system, and is depicted using a stick figure. The
role of the user is written beneath the icon. Actors are not limited to humans. If a system
communicates with another application, and expects input or delivers output, then that
application can also be considered an actor.
2
USE CASE –
A Use Case is functionality provided by the system, typically described as verb +object
(e.g. register Car, Delete User). Use Cases are depicted with an ellipse. The name of the use case
is written within the ellipse.
ASSOCIATION –
Associations are used to link Actors with Use Cases, and indicate that an Actor participates in
the Use Case in some form. Associations are depicted by a line connecting the Actor and the Use
Case.
The following image shows how these three basic elements work together to form a use case
diagram.
Use case diagrams describe what a system does from the standpoint of an external observer. The
emphasis is on what a system does rather than how. Use case diagrams are helpful in three areas.
Determining features (requirements). New use cases often generate new requirements as the system is
analyzed and the design takes shape. Communicating with clients. Their notational simplicity makes
use case diagrams a good way for developers to communicate with clients. Generating test cases. The
collection of scenarios for a use case may suggest a suite of test cases for those scenarios.
3
Figure 1.1 USE CASE DIAGRAM
4
CHAPTER-2
2.1 DESCRIPTION
The Below diagram shows how a customer book Car easily. The customer selects the
cost of renting the car directly on the home page. After that they select the required car. After
they made the selection, they entered their details which directly goes to Car Rental Company’s
database. These details are used to book the car and print the bill. The Accountant also manages
all the reports and the payments that are being booked by the customers. The payment
verification will be verified by the administrator or the accountant then the insurance company
will also verify the payment made by the customer, and finally the selected car of customer will
be confirmed and booked. This class diagram will show all the relationships between them.
2.2 FUNCTIONALITIES
ASSOCIATION
A relationship between instances of the two classes. There is an association between two classes
if an instance of one class must know about the other in order to perform its work. In a diagram,
an association is a link connecting two classes.
AGGREGATION
An association in which one class belongs to a collection. An aggregation has a diamond
end pointing to the part containing the whole.
GENERALIZATION
An inheritance link indicating one class is a superclass of the other.
MULTIPLICITY
It is an association end is the number of possible instances of the class associated with a single
instance of the other end. Multiplicities are single numbers or ranges of numbers.
5
2.3 CLASS DIAGRAM
6
CHAPTER-3
3.1 DESCRIPTION
Interaction diagrams are also collaboration diagrams. They convey the same
information as sequence diagrams, but they focus on object roles instead of the times that
messages are sent. In a sequence diagram, object roles are the vertices and messages are the
connecting links. An Interaction diagram represents a collaboration, which is a set of objects
related to a particular context, and interaction, which is a set of objects within the
collaboration, to achieve a desired outcome.
3.2 FUNCTIONALITIES
Messages in communication diagrams are shown as arrows pointing from the Client
object to the Supplier object. Typically, messages represent a client invoking an operation on a
supplier object. They can be modeled along with the objects in the following manner:
7
FIGURE 3.1 INTERACTION DIAGRAM
The above diagram shows how a customer book reservation for car easily and the customer
select the car and the rental period and Payment is done. If the details and payment are success,
car is reserved and bill is generated. It has six states each states are connecting to each other and
the connection is made between every state.
8
CHAPTER-4
IMPLEMENTATION OF STATE MACHINE DIAGRAMS
4.1 DESCRIPTION
The above diagram shows how a customer book car reservation easily and the customer
select the duration of rental or rental period directly in the home page. After that they select type
of car needed. After they made the selection they entered their detail which directly goes to car
Rental Company’s database. These details is used to book the car and print the bill.
4.2 FUNCTIONALITIES
Objects have behaviors and state. The state of an object depends on its current activity or
condition. SMD shows the possible states of the object and the transitions that cause a change in
state. States are rounded rectangles. Transitions are arrows from one state to another. Events or
conditions that trigger transitions are written beside the arrows. The initial state (black circle) is a
dummy to start the action. Final states are also dummy states that terminate the action.
State machine diagram is one of the five UML diagrams used to model dynamic nature of
a system. They define different states of an object during its lifetime. And these states are
changed by events. So State chart diagrams are useful to model reactive systems. Reactive
systems can be defined as a system that responds to external or internal events.
State machine diagram describes the flow of control from one state to another state.
States are defined as a condition in which an object exists and it changes when some event is
triggered. So the most important purpose of State chart diagram is to model life time of an object
from creation to termination. State chart diagrams are also used for forward and reverse
engineering of a system. But the main purpose is to model reactive system.
9
Following are the main purposes of using State machine diagrams:
❖ To model dynamic aspects of a system.
❖ To model life time of a reactive system.
❖ To describe states of an object during its life time.
❖ Define a state machine to model states of an object.
10
CHAPTER-5
IMPLEMENTATION OF ACTIVITY DIAGRAM
5.1 DESCRIPTION:
Activity diagrams are used to document workflows in a system, from the business level
down to the operational level. When looking at an Activity diagram, you'll notice elements from
State diagrams. In fact, the Activity diagram is a variation of the state diagram where the "states"
represent operations, and the transitions represent the activities that happen when the operation is
complete.
It captures the dynamic behavior of the system. Other four diagrams are used to show the
message flow from one object to another but activity diagram is used to show message flow from
one activity to another.
Activity is a particular operation of the system. Activity diagrams are not only used for
visualizing the dynamic nature of a system, but they are also used to construct the executable
system by using forward and reverse engineering techniques.
The only missing thing in the activity diagram is the message part. It does not show any
message flow from one activity to another. Activity diagram is sometimes considered as the
flowchart. Although the diagrams look like a flowchart, they are not. It shows different flows
such as parallel, branched, concurrent, and single.
11
5.2 FUNCTIONALITIES:
ACTIVITY STATES –
Activity states mark an action by an object. The notations for these states are rounded
rectangles, the same notation as found in State chart diagrams.
TRANSITION –
SWIM LANE -
Swim lanes divide activities according to objects by arranging objects in column format
and placing activities by that object within that column. Objects are listed at the top of the
column, and vertical bars separate the columns to form the swim lanes.
12
INITIAL STATE -
The Initial State marks the entry point and the initial Activity State. The notation for the
Initial State is the same as in State chart diagrams, a solid circle. There can only be one Initial
State on a diagram.
FINAL STATE -
Final States mark the end of the modeled workflow. There can be multiple Final States
on a diagram, and these states are modeled using a solid circle surrounded by another circle.
SYNCHRONIZATION BAR –
The below diagram shows that how a customer book a Car. If a person reserves car then
the user detail has to login or register by the customer, after successful login the user reserves the
car then the booking is confirmed and bill is prepared. If the payment failed then the booking
will be cancelled. It doesn’t do all the tasks randomly; it will do all the tasks step by step in a
proper way/method. It also shows if any car is not available which are selected by the customer,
so that the customer can select some other cars which are available and it is finally booked after
the successful payment made by the customer. It acts like a workflow which starts from initial
point to the end point and all the tasks are done properly in the activity diagram.
13
FIGURE 5.1 ACTIVITY DIAGRAM
14
CHAPTER-6
6.1 DESCRIPTION:
6.2 FUNCTIONALITIES:
COMPONENT -
A component represents a software entity in a system. Examples include source code files,
programs, documents, and resource files. A component is represented using a rectangular box,
with two rectangles protruding from the left side, as seen in the image to the right.
DEPENDENCY -
A Dependency is used to model the relationship between two components. The notation for a
dependency relationship is a dotted arrow, pointing from a component to the component it
depends on.
15
6.3 COMPONENT DIAGRAM:
The below diagram shows how the customer booking details are stored in the database. The
details of car booking are entered by the user .After the detail has been entered it goes to the
Employee Administration database which can be used to book the car and print the bill.
16
CHAPTER-7
IMPLEMENTATION OF DEPLOYMENT DIAGRAM
7.1 DESCRIPTION:
Deployment diagrams show the physical configurations of software and hardware. These
diagrams are also used to make executable systems. The following deployment diagram shows
the relationships among software and hardware components involved in real estate transactions.
The physical hardware is made up of nodes.
Deployment diagrams are made up of several UML shapes. The three-dimensional
boxes, known as nodes, represent the basic software or hardware elements, or nodes, in the
system. Lines from node to node indicate relationships, and the smaller shapes contained within
the boxes represent the software artifacts that are deployed.
7.2 FUNCTIONALITIES:
Artifact:
A product developed by the software, symbolized by a rectangle with the name and the word
“artifact” enclosed by double arrows.
Association:
A line that indicates a message or other type of communication between nodes.
Component:
A rectangle with two tabs that indicates a software element.
Dependency:
A dashed line that ends in an arrow, which indicates that one node or component is dependent on
another.
Interface:
A circle that indicates a contractual relationship. Those objects that realize the interface must
complete some sort of obligation.
Node:
A hardware or software object, shown by a three-dimensional box.
17
Node as container:
A node that contains another node inside of it—such as in the example below, where the nodes
contain components.
Stereotype:
A device contained within the node, presented at the top of the node, with the name bracketed by
double arrows.
The above diagram shows how a customer book a car. The customer selects the required
car and rental period. The customer enters the details and book the car. The car is booked and
booking status is displayed and receipt is printed. The payment is a must and it is viewed by the
administrator, Insurance Company and Accountant. If the payment is failed then the booking and
the reservation of the car will be cancelled.
Client Desktop is connected to web services and this is connected to the application
services and inside it statements and fund transfer and this application server is also connected to
the Data storage and the data storage contains account details and customer details.
18
CHAPTER-8
GENERATE CODE OF CLASS DIAGRAM FOR CAR RENTAL SYSTEM
class customer
{ int no;
char name[30];
char color[10];
int distance;
int price;
public:
int distance1()
{ return distance; }
{ strcpy(name,ob2.name);
no=ob2.no;
strcpy(color,ob2.color);
distance=ob2.distance+r;
price=ob2.price;
cout<<"NAME:";
gets(name);
cout<<"COLOUR:";
cin>>color;
19
cout<<"DISTANCE:";
cin>>distance;
cin>>price;
}ob1;
class payment
{ char name[20];
int age,carno;
char adress[30];
long number;
int days;
public:
{ void employer(int n)
gets(name);
gets(adress);
cin>>number;
carno=n;
20
cin>>days;
void display3()
{ cout<<carno<<name<<adress<<number<<days; }
{ char b[10];
char a[30];
if(t==0)
{ strcpy(b,"ob2");
strcpy(a,"info.dat");
strcpy(b,"ob1");
strcpy(a,"sports.dat");
else
if(t==3||t==33)
strcpy(b,"ob1");
strcpy(a,"suv.dat");
} else
cin>>no;
if(ob2.cno()==no)
21
cout<<"\n\n 1.SPORTS CAR";
cout<<"\n\n 3.SUV";
int op2;
cin>>op2;
int distance;
cin>>distance;
int n1=ob2.cno();
char ab[20];
switch(op2)
{ case 1:
display("sports.dat",n1);
strcpy(ab,"sports.dat");
Break; } }
void accountant()
{ cin>>option;
clrscr();
switch(option) {
case 1:
{ int n;
char namecar1[30];
22
cin>>n;
cout<<"\n\n 3.SUV";
int op3;
switch(op3)
case 1:
strcpy(namecar1,"sports.dat");
break;
case 2:
strcpy(namecar1,"leisure.dat");
break;
case 3:
strcpy(namecar1,"suv.dat");
break;
for(int i=0;i<n;i++)
filin.close();
filin2.close();
23
CHAPTER-9
IMPLEMENT GENERATED CODE USING C++ APPLICATION
24
FIGURE 9.3 RENTAL CONFIRMATION
25
CHAPTER-10
PERFORM TEST CASE AND TEST PLAN FOR CAR RENTAL SYSTEM
26
CONCLUSION
Thus the object oriented design for the Car Rental System was successfully designed. The
construction, visualization and the documentation of the artifacts of the above mentioned
software-intensive system was illustrated and specified with the help of the Unified Modeling
Language. Analogous to the use of architectural blueprints in the construction industry, UML
provides a common language for describing software models, and it can be used in conjunction
with a wide range of software lifecycles and development processes. This software is efficient in
maintaining customer’s details and can easily perform operations on customer’s records. This
software also reduces the workload of the travel agency manager.
In future, this system can launch web site for easy online registration. In this system there
is limitation for cars and location. In future, it can be extended to add more location and cars.
27