Exercise: Event Reservation System
You will create a Java program for booking event reservations. The system should:
1. Validate a booking code.
2. Validate a password for accessing the reservation.
3. Ensure proper messages are returned based on the validation results.
Requirements:
1. checkBookingCode(String code):
o The booking code must contain an underscore (_) and should not exceed 12
characters.
o Example valid code: Event_123
o Returns true if valid, otherwise false.
2. checkPasswordComplexity(String password):
o Password must meet the following requirements:
▪ At least 8 characters long.
▪ Contains at least one capital letter.
▪ Contains at least one number.
▪ Contains at least one special character (e.g., !, @, #, etc.).
o Returns true if valid, otherwise false.
3. makeReservation(String bookingCode, String password):
o This method returns messages based on:
▪ If the booking code is incorrectly formatted.
▪ If the password does not meet complexity requirements.
o If both are valid, it confirms the reservation.
Example Output:
• If the booking code is invalid: "Booking code is incorrectly formatted."
• If the password is invalid: "Password does not meet the complexity requirements."
• If both are valid: "Reservation successfully made!"