Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Context A movie theater is testing a ticket purchasing system that allows customers to select their seat in the theater at the time of
C++
Context A movie theater is testing a ticket purchasing system that allows customers to select their seat in the theater at the time of purchase. This movie theater has 30 available seats in each theater (numbered 0-29) and once a seat has been selected by one customer, it is marked as booked and cannot be selected by another customer. For the purposes of this simulation, we will assume that patrons are not willing to purchase a ticket if their preferred seat is unavailable, so they will leave without buying a ticket. Problem - The purpose of this program is to determine whether this seat selection system is efficient. In order to test efficiency, the manager of the theater has set an acceptable success rate to compare the observed success rate against. success rate- # of completed transactions (where the desired seat is not already booked) / # of attempted transactions If the observed success rate is less than the acceptable success rate, the simulated set of transactions fails to meet the minimum requirements for efficiency. To begin the simulation, the user will input a number of iterations to be evaluated as well as the number of attempted transactions per iteration. Iterations can be thought of as showtimes in a given theater. Each iteration begins with 30 empty seats which can then be booked by customers. We will simulate the selection of seats by using the rand0 function to generate random numbers ranging from 0 to 29 corresponding to seats in the theater. In order to use the rand0 function, you must first include stdlib.h and call the srandO function and pass a seed value to it. The seed value will be input by the user. Ex #includeStep 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