Assignment (FInals)
Assignment (FInals)
Bahawalpur
Faculty of Engineering & Technology
Department of Computer Systems Engineering
Name: Swaira Riaz Roll_No. 22-CSE-18
Session: 2022-26 (6th Semester) Max. Marks: 10
Course: COMP 02632 (Software Engineering) Instructor: Engr. Sajida Hassan
Assignment: 2 (CLO2)
Q#01 Design and implement the state diagram for the weather station system that
shows how it responds to requests for various services?
Answer:
Explanation:
This state diagram represents the behavior of a Weather Station System in response
to requests for various services such as data collection, transmission, error handling,
and shutdown.
States:
Transitions:
Implementation Tool:
This diagram was implemented using UML Designer, which supports the creation of
state machine diagrams according to UML standards.
Diagram:
Q#02 Using the UML graphical notation for object classes, design the following
object classes, identifying attributes and operations. Use your own experience to
decide on the attributes and operations that should be associated with these objects.
(i) a telephone
(ii) a printer for a personal computer
(iii) a personal stereo system
Answer:
Design UML class diagrams for the following objects, identifying appropriate
attributes and operations.
1. Telephone
Attributes:
brand: String
model: String
phoneNumber: String
isRinging: Boolean
Operations:
makeCall(number: String)
receiveCall()
endCall()
checkStatus()
Attributes:
brand: String
model: String
status: String
paperLevel: Integer
inkLevel: Integer
Operations:
printDocument(file: String)
checkStatus()
refillPaper()
replaceInk()
Attributes:
brand: String
model: String
batteryLevel: Integer
currentTrack: String
volumeLevel: Integer
Operations:
play()
pause()
stop()
nextTrack()
increaseVolume()
decreaseVolume()
Diagram:
Answer:
1. Diagram Overview
The sequence diagram models the interaction between system components during
meeting scheduling in a Group Diary System. Key elements include:
Six lifelines: User, GroupDiarySystem, CalendarManager, two Participants,
and NotificationService
12 message exchanges with synchronous and asynchronous communication
Activation bars showing processing periods
2. Core Workflow
3. Design Highlights
Clear separation of concerns between components
Optimal use of asynchronous messaging for notifications
Synchronous operations for critical path activities
Linear workflow with well-defined decision points
4. Technical Merits
Diagram:
Q#04 Develop a UML state diagram showing the possible state changes in either the
group diary or the filling station system.
Answer:
1. Diagram Overview
The state diagram (Fig. 1) models the meeting scheduling lifecycle in a Group Diary
System, comprising:
8 states (Idle → NotificationSent)
12 transitions with triggers/guards
3 critical paths: Success flow, cancellation, timeout
2. Core State Logic
Success Path:
Idle → MeetingInitiated → TimeProposed → CheckingAvailability →
AwaitingResponses → TimeConfirmed → NotificationSent
Error Handling:
o Timeout: AwaitingResponses → Cancelled
o Manual cancellation: Any state → Cancelled
4. Technical Validation
Consistency: Single start (Idle) and end (NotificationSent/Final) points
Completeness: Covers 100% of use cases (success/failure/timeout)
Scalability: Modular design allows adding states (e.g., RecurringMeeting)
Diagram:
Q#05 Identify possible objects in the following system and develop an object-
oriented design for the given system. You may make any reasonable assumptions
about the systems when deriving the design.
A filling station (gas station) is to be set up for fully automated operation. Drivers
swipe their credit card through a reader connected to the pump; the card is verified by
communication with a credit company computer, and a fuel limit is established. The
driver may then take the fuel required. When fuel delivery is complete and the pump
hose is returned to its holster, the driver’s credit card account is debited with the cost
of the fuel taken. The credit card is returned after debiting. If the card is invalid, the
pump returns it before fuel is dispensed.
3. OO Principles Applied