0% found this document useful (0 votes)
2 views1 page

Programming Test

The document outlines the requirements for a Java program that manages event reservations. It specifies the validation criteria for booking codes and passwords, including format and complexity requirements. The program should return appropriate messages based on the validation results during the reservation process.

Uploaded by

Unahh Il
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Programming Test

The document outlines the requirements for a Java program that manages event reservations. It specifies the validation criteria for booking codes and passwords, including format and complexity requirements. The program should return appropriate messages based on the validation results during the reservation process.

Uploaded by

Unahh Il
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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!"

You might also like