pandiyammal-24/Railway-Ticket-Reservation-System ? reverse-engineered prompt

Reverse engineered prompt

Build me a Java console app for a Railway Ticket Reservation System that feels like a small real world booking tool.

It should let a user book and cancel tickets, check seat availability, view active tickets, and see booking history. When seats run out, the system should automatically move passengers into RAC and then into a waiting list, and promote people correctly when a ticket gets cancelled. I want support for multiple trains, simple passenger details, and a clean menu based flow that is easy to use from the terminal.

Please organize it with good object oriented design, use SOLID principles, and include a Singleton style booking manager. Payment should be handled through different methods like UPI, card, and cash in a way that is easy to extend later. Use Java collections sensibly for active tickets, queues for confirmed, RAC, and waiting lists, and a list for history.

Make it run in Java 17, keep the code clean and readable, and look up current Java docs online if you need to.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab