tity; private int capacity; private int seatsTaken; public DesertEvent(String eventName, String eve
The Driver class (TestDesertEvent)
four event objects, each an object of the class type
DesertEvents, in the main method:
DesertEvent event1 = new DesertEvent (“Success in Life ”,
“Workshop”);
DesertEvent event2 = new DesertEvent (“Seminar Prep”,
“Seminar”, 50);
DesertEvent event2 = new DesertEvent (“Working with others”,
“Workshop”, 10);
DesertEvent event3 = new DesertEvent (“career fair”, “Career
fair”)
Then, the program should display a welcome message and the following menu to
choose from:
Please choose one of the following:
L – list all available events
IR – individual registration
GR – group registration
Q – quit
The menu should be displayed by calling a static method inside DesertEvent class
called displayMenu(). The menu should keep repeating until the user chooses to quit. See
sample outputs below:
Sample output (user input in bold):
Welcome to DesertEvents page!
Please choose one of the following:
L – list all available events
IR – individual registration
GR – group registration
Q – quit
Enter your choice: X
Invalid input
Please choose one of the following:
L – list all available events
IR – individual registration
GR – group registration
Q – quit
Enter your choice: L
SJH23354 Success in Life Library Meeting Room 28 FULL
IVA56742 Seminar prep High Rise 151 49 seats
SPA49492 Career Fair. Theatre Unlimited
WJH99051 Working with others Fitch Hall 28 10 seats
Please choose one of the following:
L – list all available events
IR – individual registration
GR – group registration
Q – quit
Enter your choice: IR
For which event? XXX
Sorry, no matching order was found.
Enter your choice: IR
For which event? SJH23354
Sorry, we have reached the maximum number of seats for this event.
Please choose one of the following:
L – list all available events
IR – individual registration
GR – group registration
Q – quit
Enter your choice: IR
For which event? IVA56742
Registration successful.
Enter your choice: L
SJH23354 Success in Life Library Meeting Room 28 FULL
IVA56742 Seminar prep High Rise151 49 seats
SPA49492 CareerFair. Theatre Unlimited
WJH99051 Working with others Fitch Hall 28 10 seats
Please choose one of the following:
L – list all available events
IR – individual registration
GR – group registration
Q – quit
Enter your choice: GR
For which event? WJH99051
How many seats? 9
Registration successful
Enter your choice: L
SJH2335 Success in Life Library Meeting Rooml 28 FULL
IVA5674 Seminar Prep High Rise 151 49 seats
SPA4949 Career Fair. Theatre Unlimited
WJH9905 Working in Teams Fitch Hall 28 1 seat
Please choose one of the following:
L – list all available events
IR – individual registration
GR – group registration
Q – quit
Enter your choice: Q
Goodbye!
Step by step
Solved in 2 steps