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

Opening a template is free and never counts toward your daily diagrams. Asking the AI to change it counts as one.

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

Inside this diagram

A class diagram with 9 classes and 8 relationships.

Classes

  • Hotel: fields name, city; methods findAvailable(Date from, Date to)
  • Room: fields number, floor, status
  • RoomType: fields name, nightlyRate, capacity
  • Guest: fields id, name, phone; methods book(List~Room~ rooms, Date from, Date to)
  • Booking: fields id, checkIn, checkOut, status; methods total(), cancel()
  • Payment: interface; methods pay(decimal amount)
  • CardPayment: fields cardLast4; methods pay(decimal amount)
  • UpiPayment: fields vpa; methods pay(decimal amount)
  • Invoice: fields total, issuedOn

Relationships

  • Hotel is made up of Room
  • Room uses RoomType
  • Guest uses Booking
  • Booking has Room
  • Booking uses Payment
  • CardPayment implements Payment
  • UpiPayment implements Payment
  • Booking depends on Invoice (creates)

Make your own diagram like this

Describe your own system in plain English and CloudSketch AI draws it in seconds. See all AI diagram generators.

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.