0% found this document useful (0 votes)
78 views

UML Assignment

Uploaded by

guptaarchana397
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views

UML Assignment

Uploaded by

guptaarchana397
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Q.1.

Draw following diagram for booking ola cab

a. Class Diagram

b. Use Diagram

c. Activity Diagram

d. State Chart Diagram

Ans=

a) Class diagram:-

a. Class Diagram

Key Classes and Relationships:

 User:

o Attributes: userId, name, email, phoneNumber, location

o Methods: register, login, updateProfile, cancelRide

 Cab:

o Attributes: cabId, cabType, location, availability, driverId

o Methods: assignDriver, updateLocation, changeAvailability

 Driver:

o Attributes: driverId, name, phoneNumber, vehicleNumber, currentLocation

o Methods: acceptRide, startRide, endRide

 Ride:

o Attributes: rideId, userId, driverId, pickupLocation, dropLocation, fare, status

o Methods: bookRide, startRide, endRide, cancelRide


Relationships:

 User and Ride have a many-to-many relationship.

 Driver and Ride have a many-to-many relationship.

 Cab and Driver have a one-to-one relationship.

2) Use diagram :-

b. Use Case Diagram

Key Use Cases:

 User Registration: User provides personal information to create an account.

 User Login: User enters credentials to access the app.

 Book Ride: User specifies pickup and drop locations, selects a cab type, and books a ride.

 Track Ride: User tracks the real-time location of the assigned cab.

 Cancel Ride: User cancels a booked ride.

 Rate Ride: User rates the driver and the ride experience.

 Payment: User makes payment for the completed ride.

C) activity diagram :-
c. Activity Diagram

Activities:

1. User Login/Registration: User either logs in or registers a new account.

2. Select Pickup Location: User enters the pickup location.

3. Select Drop Location: User enters the drop location.

4. Choose Cab Type: User selects a preferred cab type.

5. Book Ride: User confirms the booking details and books the ride.

6. Assign Driver: System assigns an available driver to the ride.

7. Driver Accepts Ride: Driver accepts or rejects the ride request.

8. Start Ride: Driver starts the ride and the user is notified.

9. End Ride: Ride ends at the drop location.


10. Payment: User makes the payment for the ride.

11. Rate Ride: User rates the driver and the ride experience.

D) state chart diagram :-

d. State Chart Diagram

States:

 Idle: Initial state where the user is not in a ride.

 Booking: User is in the process of booking a ride.

 Assigned: A driver has been assigned to the ride.

 In-Progress: The ride is ongoing.

 Completed: The ride has been completed.

 Cancelled: The ride has been cancelled.

Transitions:

 Idle -> Booking: User initiates a ride request.

 Booking -> Assigned: A driver is assigned to the ride.

 Assigned -> In-Progress: The driver starts the ride.

 In-Progress -> Completed: The ride ends at the drop location.

 In-Progress -> Cancelled: The ride is cancelled by the user or driver.


 Completed -> Idle: The ride is finished and the user returns to the idle state.

 Cancelled -> Idle: The ride is cancelled and the user returns to the idle state

Q.2.Draw sequence diagram, State Chart Diagram, use case diagram and class diagram for
ordering food online from any app.

Ans:-

1. Sequence diagram :-

2. State diagram :-

3.Use case diagram :-


4.Class Diagram :-
Q.3.Draw Sequence Diagram for search engine (google.com, yahoo.com etc) for
searching a specified text, site or documents over an Internet.

Ans:-
Q.4.What is Static and Dynamic Model? State its purpose with suitable example

Ans:-

*Static Model*:

- *Definition*: Represents the structural aspects of a system. It shows what parts exist
and how they are organized but not how they interact or change.

- *Purpose*: To depict the static structure, including classes, objects, attributes, and their
relationships.

- *Example in UML*: Class Diagrams are a typical example of a static model,


representing the system's classes and their relationships, such as inheritance or
association.

*Dynamic Model*:
- *Definition*: Represents the behavioral aspects, showing how the system changes over
time in response to events.

- *Purpose*: To visualize interactions, control flows, and changes in the system state.

- *Example in UML*: Sequence Diagrams and State Machine Diagrams are dynamic
models, as they demonstrate how objects interact and the order of these interactions.

Q .5.Write the purpose of Fork node and swimlanes in UML

Ans :-

*Fork Node*:

- *Definition*: Used in Activity Diagrams to split one control flow into multiple parallel
flows.

- *Purpose*: To represent concurrent processing, where multiple activities can be


executed simultaneously after a fork node.

- *Example*: In a workflow where several tasks (e.g., verifying a user's identity and
loading their profile) need to happen simultaneously.

- *Swimlanes*:

- *Definition*: Visual partitions within an Activity Diagram that group related activities
by responsibility.

- *Purpose*: To clarify responsibilities by showing which actor or part of the system


performs which actions.

- *Example*: In a business process, swimlanes can separate actions performed by


different departments, like "Sales" and "Finance".

Q.6.How object oriented concepts are related to UML?

Ans:-

UML is built on *object-oriented (OO) principles*, which include:

- *Encapsulation*: Classes and objects in UML diagrams encapsulate data and behaviors,
hiding internal details.

- *Inheritance*: Class diagrams allow us to model inheritance relationships, where


subclasses inherit properties and methods from a superclass.
- *Polymorphism*: UML represents how objects of different types can be treated as
instances of a parent type, important in sequence and class diagrams.

- *Abstraction*: UML helps in modeling only essential details of a system through


various diagrams, ignoring less critical details.

Q.7.What are principles of modelling ?

Ans :-

The principles guiding UML modeling include:

- *Abstraction*: Simplifying complex reality by modeling only the essential details.

- *Understandability*: Ensuring the model is easy to interpret for stakeholders and


developers.

- *Accuracy*: Creating models that accurately represent the real-world system's


requirements and constraints.

- *Consistency*: Maintaining consistent naming, symbols, and notations across models.

- *Completeness*: Ensuring all important aspects of the system are represented.

Q.8.What is State Machine?

Ans :-

*Definition*: A State Machine Diagram models the behavior of an object in terms of its states
and transitions.

- *Purpose*: It shows how an object moves from one state to another based on events, which
is essential for modeling complex behaviors.

- *Example*: A State Machine Diagram for an order object can show states like "New",
"Processing", "Shipped", and "Delivered", with transitions based on order status updates.

Each of these UML concepts helps in visualizing and modeling different aspects of an object-
oriented system, making it easier to design, develop, and understand complex software.

Q.9.Consider a use of a "Rent a car". Customers rent online from choice of cars. A
transaction of Renting car is hired, rate of hiring, etc. Payments can be done in various
ways. Loyal customers with repeat business may be given discounts. Some
of the likely classes are cars, Types cars, Rates card, customers,
Transactions for renting the car, payment,
draw class diagram, use case diagram, activity diagram for above problem statement.

Ans :-

Classes of Car Rental System Class Diagram:

• Cars Class: Manage all the operations of Cars

• Booking Class: Manage all the operations of Booking

• Passenger Class: Manage all the operations of Passenger

• Car Routes Class: Manage all the operations of Car Routes

• Drivers Class: Manage all the operations of Drivers

• ##Class6## Class: Manage all the operations of ##Class6##

Classes and their attributes of Car Rental System Class Diagram:

• Cars Attributes: car_id, car_driver_id, car_customer_id, car_number, car_company


car_type, car_description

• Booking Attributes: booking_id, booking_title, booking_type, booking_ticket,


booking_date, booking_description

• Passenger Attributes: passenger_id, passenger_name, passenger_mobile,


passenger_email, passenger_username, passenger_password, passenger_address

• Car Routes Attributes: car_route_id, car_route_name, car_route_type,


car_route_description

• Drivers Attributes: driver_id, driver_name, driver_mobile, driver_email,


driver_username, driver_password, driver_address, driver_licence

• ##Class6## Attributes: ##AttributeList6##

Classes and their methods of Car Rental System Class Diagram:

• Cars Methods: addCars(), editCars(), deleteCars(), updateCars(), saveCars(),


searchCars()

• Booking Methods: addBooking(), editBooking(), deleteBooking(), updateBooking(),


saveBooking(), searchBooking()

• Passenger Methods: addPassenger(), editPassenger(), deletePassenger(),


updatePassenger(), savePassenger(), searchPassenger()
• Car Routes Methods: addCar Routes(), editCar Routes(), deleteCar Routes(), updateCar
Routes(), saveCar Routes(), searchCar Routes()

• Drivers Methods: addDrivers(), editDrivers(), deleteDrivers(), updateDrivers(),


saveDrivers(), searchDrivers()

• ##Class6## Methods: add##Class6##(), edit##Class6##(), delete##Class6##(),


update##Class6##(), save##Class6##(), search##Class6##()

Use Case Diagram :-

Key Use Cases:


 Customer Registration: User creates an account with personal information.

 Customer Login: User logs into their account.

 Browse Cars: User views available cars and their details.

 Select Car: User selects a car to rent.

 Book Car: User provides rental details (start date, end date) and books the car.

 Make Payment: User selects a payment method and completes the payment.

 Cancel Reservation: User cancels a booked reservation.

 Rate Rental Experience: User rates the rental experience.

Activity diagram :-

Key Activities:

1. Customer Login/Registration: User either logs in or registers a new account.

2. Browse Cars: User browses the available car options.

3. Select Car: User selects a desired car.


4. Provide Rental Details: User enters the rental start date and end date.

5. Calculate Rental Cost: System calculates the total rental cost based on the car type
and rental duration.

6. Make Payment: User selects a payment method and completes the payment.

7. Confirm Booking: System confirms the booking and sends a confirmation to the
user.

8. Car Pickup: User picks up the rented car.

9. Car Return: User returns the rented car.

10. Payment Verification: System verifies the payment.

11. Rental Completion: Rental is completed and the transaction is recorded.

Q.10. A system is designed for processing results of students. Students fills the
examination form by giving details about subject, centre etc. which is an input to the system.
Student pays examination fees. Fee receipt and admit card of examination should get
generated. Examination is conducted at various centres. Centres provide absentee report. The
evaluation department provides marks of students in each subject. Mark sheet and merit list
are the output of the system. State your assumptions clearly and Draw following Class
Diagrams,use case diagram.

Ans :-

Class diagram :-
Key Classes and Relationships:

 Student:

o Attributes: studentId, name, address, contactNumber

 Exam:

o Attributes: examId, examName, examDate

 Center:

o Attributes: centerId, centerName, centerAddress

 Subject:

o Attributes: subjectId, subjectName

 Result:

o Attributes: resultId, studentId, examId, subjectId, marks

 Fee:

o Attributes: feeId, studentId, examId, amount, paymentDate

 AdmitCard:

o Attributes: admitCardId, studentId, examId, centerId, examDate


Relationships:

 Student and Result have a one-to-many relationship.

 Exam and Result have a one-to-many relationship.

 Subject and Result have a one-to-many relationship.

 Center and Exam have a many-to-many relationship.

 Student and Fee have a one-to-many relationship.

 Student and AdmitCard have a one-to-many relationship.

 Exam and AdmitCard have a one-to-many relationship.

Use case Diagram:-

Key Use Cases:

 Student Registration: Student registers for an exam.

 Fee Payment: Student pays the examination fee.

 Admit Card Generation: System generates admit cards for registered students.

 Conduct Exam: Exam is conducted at various centers.

 Mark Entry: Exam invigilators enter marks for each student.

 Result Processing: System processes the marks and generates results.

 Mark Sheet Generation: System generates mark sheets for each student.

 Merit List Generation: System generates a merit list based on the results.

You might also like