Box office. Someone walks up with a seat number and I need toknow fast whether it has been sold. The sold list is kept inorder. Do not make me wait while it checks all of them.Write your requirements list before you write any code. Input, calculate, output, and anything you had to decide for yourself.
Sold list is in order.Seat 55: sold (3 checks)Seat 12: sold (3 checks)Seat 50: available (3 checks)Seven sold seats, so binary search never needs more than three checks. Try your sorted check on an array with two seats swapped.
Your requirements list and your program file, named cc-box-office.