CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
πŸŒ™β˜€οΈ
Log inStart free
Home/Templates/Student Projects (College Reports)

πŸŽ“ Student Projects (College Reports) Β· Class UML

Hotel Room Booking System Class Diagram

Main classes of a hotel booking system, including room types and a payment interface.

More Student Projects (College Reports) templates

Drawing diagram…

What this diagram shows

  • Payment as an interface with card and UPI implementations
  • Booking aggregates rooms
  • Hotel composes rooms

Prompt used

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.

Mermaid code
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 : creates

Related templates

Use CaseStudent Projects (College Reports)

Library Management System Use Case Diagram

Who uses a college library system and what each of them can do: members, the librarian and the system administrator.

Database ERDStudent Projects (College Reports)

Library Management System ER Diagram

The database of a library system: books and their copies, authors, members, loans, reservations and fines, with keys and cardinality.

Data FlowStudent Projects (College Reports)

Library Management System Data Flow Diagram (Level 1)

How data moves through a library system: members and the librarian, the main processes, and the data stores they read and write.

Class UMLStudent Projects (College Reports)

Library Management System Class Diagram

The main classes of a library system with attributes, methods and UML relationships.

SequenceStudent Projects (College Reports)

Library Management System Sequence Diagram (Issue a Book)

The steps when a member borrows a book: checks, loan record and the copy status update.

Use CaseStudent Projects (College Reports)

Online Examination System Use Case Diagram

What students, examiners and the administrator do in an online examination system.