0% found this document useful (0 votes)
5 views4 pages

Movie Theatre System Class Overview

The document outlines the structure and functionality of a movie theatre management system, detailing classes for Customer, Ticket, Hall, Seat, MovieSession, TheatreStaff, and the main MovieTheatreSystem class. Each class has specific attributes and methods that facilitate ticket scanning, seat assignment, occupancy management, and operational reporting. The workflow describes how customers interact with the system during a movie session, including ticket validation and staff monitoring of hall occupancy.

Uploaded by

tasnim.monir
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

Movie Theatre System Class Overview

The document outlines the structure and functionality of a movie theatre management system, detailing classes for Customer, Ticket, Hall, Seat, MovieSession, TheatreStaff, and the main MovieTheatreSystem class. Each class has specific attributes and methods that facilitate ticket scanning, seat assignment, occupancy management, and operational reporting. The workflow describes how customers interact with the system during a movie session, including ticket validation and staff monitoring of hall occupancy.

Uploaded by

tasnim.monir
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

Customer Class

Purpose: Represents a customer visiting the movie theatre. This class is responsible for ticket
scanning and retrieving the assigned seat.

 Attributes:
o customerId: A unique identifier for each customer.
o name: The name of the customer.
o ticketId: The ID of the ticket assigned to the customer.
 Methods:
o scanTicket(Ticket ticket, Hall hall):
 Simulates the customer scanning their ticket.
 Validates the ticket using the validateTicket() method of the Ticket class.
 Updates hall occupancy if the ticket is valid.
o getSeatAssignment(Ticket ticket):
 Returns the seat number associated with the ticket.

2. Ticket Class

Purpose: Represents a movie ticket. This class handles ticket validation and seat assignment.

 Attributes:
o ticketId: A unique identifier for each ticket.
o seatNumber: The seat number assigned to the ticket holder.
o hallId: The ID of the hall where the ticket is valid.
o isUsed: A flag indicating whether the ticket has already been used.
 Methods:
o validateTicket():
 Checks if the ticket is already used.
 Marks the ticket as used if it’s valid and returns true; otherwise, returns
false.
o assignSeat(int seatNumber):
 Assigns a seat to the ticket holder.

3. Hall Class

Purpose: Represents the movie hall where the sessions are held. This class manages seat
availability and occupancy.

 Attributes:
o hallId: A unique identifier for the hall.
o totalSeats: Total number of seats in the hall.
ooccupiedSeats: Number of seats currently occupied.
 Methods:
o updateOccupancy():
 Increases the occupiedSeats count by 1 when a valid ticket is scanned.
o checkAvailability():
 Returns the number of available seats by subtracting occupiedSeats from
totalSeats.

4. Seat Class

Purpose: Represents a seat in the movie hall. This class is used for marking a seat as occupied or
vacant.

 Attributes:
o seatNumber: A unique number identifying the seat.
o isOccupied: A flag indicating whether the seat is currently occupied.
 Methods:
o occupySeat():
 Marks the seat as occupied by setting isOccupied to true.
o vacateSeat():
 Frees up the seat by setting isOccupied to false.

5. MovieSession Class

Purpose: Represents a movie session. This class is responsible for managing the session’s
lifecycle.

 Attributes:
o sessionId: A unique identifier for the movie session.
o movieTitle: The title of the movie being shown.
o showTime: The date and time of the movie session.
 Methods:
o startSession():
 Prints a message indicating the movie session has started.
o endSession(Hall hall):
 Prints a message indicating the session has ended.
 Resets the hall’s occupancy to 0.

6. TheatreStaff Class
Purpose: Represents a staff member working at the theatre. This class is responsible for
monitoring hall occupancy and generating operational reports.

 Attributes:
o staffId: A unique identifier for the staff member.
o name: The name of the staff member.
o role: The role of the staff member (e.g., Manager).
 Methods:
o monitorOccupancy(Hall hall):
 Prints the current occupancy of the hall in the format
occupiedSeats/totalSeats.
o generateReport(Hall hall):
 Prints a detailed operational report, including the total seats and occupied
seats.

7. MovieTheatreSystem Class (Main Class)

Purpose: The entry point of the program. This class orchestrates the interactions between other
classes.

 Responsibilities:
1. Create objects for Hall, Ticket, Customer, MovieSession, and TheatreStaff.
2. Start the movie session and process ticket scanning for customers.
3. Update hall occupancy for valid tickets and handle invalid tickets.
4. Generate operational reports and reset occupancy when the session ends.

Relationships Between Classes

 Customer ↔ Ticket: A customer scans a ticket to validate it.


 Ticket ↔ Hall: A ticket is tied to a specific hall (via hallId).
 Hall ↔ Seat: Each hall has seats, and their occupancy is managed.
 Hall ↔ MovieSession: The movie session manages the occupancy of the hall.
 Hall ↔ TheatreStaff: Staff monitor the hall’s occupancy and generate reports.

How the Program Works (Workflow):

1. A movie session starts, and customers scan their tickets at the entry.
2. For each ticket:
o If valid, the system records the entry and updates the hall's occupancy.
o If invalid, the system denies entry and prints an error message.
3. Theatre staff monitor and report the hall occupancy.
4. At the end of the session, the hall occupancy is reset to prepare for the next session.

This explanation should give you a solid understanding of the program and how the different
components interact. Let me know if you'd like any part clarified further!

You might also like