UML Assignment
UML Assignment
a. Class Diagram
b. Use Diagram
c. Activity Diagram
Ans=
a) Class diagram:-
a. Class Diagram
User:
Cab:
Driver:
Ride:
2) Use diagram :-
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.
Rate Ride: User rates the driver and the ride experience.
C) activity diagram :-
c. Activity Diagram
Activities:
5. Book Ride: User confirms the booking details and books the ride.
8. Start Ride: Driver starts the ride and the user is notified.
11. Rate Ride: User rates the driver and the ride experience.
States:
Transitions:
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 :-
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.
*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.
Ans :-
*Fork Node*:
- *Definition*: Used in Activity Diagrams to split one control flow into multiple parallel
flows.
- *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.
Ans:-
- *Encapsulation*: Classes and objects in UML diagrams encapsulate data and behaviors,
hiding internal details.
Ans :-
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 :-
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.
Activity diagram :-
Key Activities:
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.
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:
Exam:
Center:
Subject:
Result:
Fee:
AdmitCard:
Admit Card Generation: System generates admit cards for registered students.
Mark Sheet Generation: System generates mark sheets for each student.
Merit List Generation: System generates a merit list based on the results.