
π Student Projects (College Reports) Β· Class UML
Main classes of a hotel booking system, including room types and a payment interface.
Drawing diagramβ¦
Class diagram for a hotel room booking system: Hotel has many Rooms; Room has a RoomType with a nightly rate; Guest makes Bookings; Booking covers one or more rooms, calculates the total and can be cancelled; Payment is an interface implemented by CardPayment and UpiPayment; Invoice is created from a booking at check-out.
classDiagram
class Hotel {
+String name
+String city
+findAvailable(Date from, Date to) List~Room~
}
class Room {
+int number
+int floor
+String status
}
class RoomType {
+String name
+decimal nightlyRate
+int capacity
}
class Guest {
+int id
+String name
+String phone
+book(List~Room~ rooms, Date from, Date to) Booking
}
class Booking {
+int id
+Date checkIn
+Date checkOut
+String status
+total() decimal
+cancel() void
}
class Payment {
<<interface>>
+pay(decimal amount) bool
}
class CardPayment {
+String cardLast4
+pay(decimal amount) bool
}
class UpiPayment {
+String vpa
+pay(decimal amount) bool
}
class Invoice {
+decimal total
+Date issuedOn
}
Hotel "1" *-- "many" Room
Room --> RoomType
Guest "1" --> "many" Booking
Booking "1" o-- "many" Room
Booking --> Payment
Payment <|.. CardPayment
Payment <|.. UpiPayment
Booking ..> Invoice : createsWho uses a college library system and what each of them can do: members, the librarian and the system administrator.
The database of a library system: books and their copies, authors, members, loans, reservations and fines, with keys and cardinality.
How data moves through a library system: members and the librarian, the main processes, and the data stores they read and write.
The main classes of a library system with attributes, methods and UML relationships.
The steps when a member borrows a book: checks, loan record and the copy status update.
What students, examiners and the administrator do in an online examination system.