Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Im working on a project that one of the output has to be like the one below: Booth 1 TANVIR from line 6 checks out
Im working on a project that one of the output has to be like the one below:
Booth
TANVIR from line checks out at time
ARUP from line checks out at time
TRAVIS from line checks out at time
GUSTAVO from line checks out at time
DANIEL from line checks out at time
ANEESHA from line checks out at time
GUHA from line checks out at time
SHARON from line checks out at time
Booth
XIE from line checks out at time
JOSE from line checks out at time
VENU from line checks out at time
ANSH from line checks out at time
NELLY from line checks out at time
Booth
LILY from line checks out at time
MEADE from line checks out at time
MASON from line checks out at time
LEAVENS from line checks out at time
but currently, my output is just:
Booth
Booth
Booth
The input is as follows:
TANVIR
ARUP
TRAVIS
LILY
XIE
GUSTAVO
JOSE
DANIEL
VENU
ANEESHA
ANSH
GUHA
MEADE
MASON
NELLY
SHARON
LEAVENS
Please help me solve the issues, my code is this:
#include
#include
#include
struct Customer
char name;
int tickets;
int arrivalTime;
;
struct QueueNode
struct Customer customer;
struct QueueNode next;
;
struct Queue
struct QueueNode front;
struct QueueNode rear;
;
void initializeQueuestruct Queue queue
queuefront NULL;
queuerear NULL;
int isQueueEmptystruct Queue queue
return queuefront NULL;
void enqueuestruct Queue queue, struct Customer customer
struct QueueNode newNode struct QueueNodemallocsizeofstruct QueueNode;
newNodecustomer customer;
newNodenext NULL;
if isQueueEmptyqueue
queuefront newNode;
queuerear newNode;
else
queuerearnext newNode;
queuerear newNode;
struct Customer dequeuestruct Queue queue
if isQueueEmptyqueue
struct Customer emptyCustomer;
strcpyemptyCustomername, ;
emptyCustomer.tickets ;
emptyCustomer.arrivalTime ;
return emptyCustomer;
else
struct QueueNode temp queuefront;
struct Customer dequeuedCustomer tempcustomer;
queuefront tempnext;
if queuefront NULL
queuerear NULL;
freetemp;
return dequeuedCustomer;
int determineQueueNumberchar firstLetter
int position firstLetter A;
int queueNumber position ;
if queueNumber
return ;
else
return queueNumber;
int main
int n b;
scanfd d &n &b;
struct Queue queues;
for int i ; i ; i
initializeQueue&queuesi;
for int i ; i n; i
struct Customer customer;
scanfs d d customer.name, &customer.tickets, &customer.arrivalTime;
int queueNumber determineQueueNumbercustomername;
enqueue&queuesqueueNumber customer;
for int i ; i b; i
Print booth header
printfBooth d
i;
for int j ; j ; j
printf
;
return ;
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