Specify the seating order as the names separated by commas.

Language: Java

Challenge:

Five friends are going to the theater. They have purchased a row of five seats with an aisle on either end.
James doesn’t want to sit next to Jill
Betty and Herb are dating and want to sit next to each other
Bob must sit on an aisle
Provide a seating order that conforms to the above rules. An example of an invalid seating order is:
James, Betty, Herb, Bob, Jill
The above arrangement is invalid because: Bob is not sitting on an aisle.

Specify the seating order as the names separated by commas (as in the above example). Please be sure to spell the names  correctly, including capitalization.

SOLUTION:

Language: Java

Challenge:

Five friends are going to the theater. They have purchased a row of five seats with an aisle on either end.
James doesn’t want to sit next to Jill
Betty and Herb are dating and want to sit next to each other
Bob must sit on an aisle
Provide a seating order that conforms to the above rules. An example of an invalid seating order is:
James, Betty, Herb, Bob, Jill
The above arrangement is invalid because: Bob is not sitting on an aisle.

Specify the seating order as the names separated by commas (as in the above example). Please be sure to spell the names  correctly, including capitalization.

Solution:

James,Betty,Herb,Jill,Bob