Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The following code defines a story of Two tourists John and Martin (represented by 2 threads) each of them wants to book 2 bus tickets.
The following code defines a story of Two tourists John and Martin (represented by 2 threads) each of them wants to book 2 bus tickets. The number of available seats in the next bus are 3 seats only. Implement class TicketCounter that contains the available number of seats (3 seats only) with a method bookticket that receives the tourist name and number of seated that he wants to reserve. The method should print the name of the tourist and state whether he could book the seats he wants successfully or not.
public class Test \{Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started