Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q:how i can write these code without using pair #include #include using namespace std; int main() { int time_t; cout < >time_t; //int n=time_t; queue

Q:how i can write these code without using pair

#include #include using namespace std; int main() { int time_t; cout<<"Enter the time limit : "; cin>>time_t; //int n=time_t; queue >q; int nop=0,nops=0,max=0,totalwait=0,numbermax; float average; while(time_t!=0) { int x; /*Asking for new added passengers in the queue*/ cout<<"Please enter the number of passengers entered(between 0 to 2)- "; cin>>x; if(x<0 or x>2) { /* If number of passengers is not between 0 to 2 then ask again for valid entry*/ cout<<"Please enter valid number of new passengers"< served= q.front(); //passsenger who is given the ticket totalwait+= served.second; cout<<"Waiting time for passsenger number "<max) { max=served.second; //update the maximum Waiting time numbermax=served.first; } nops++; q.pop(); time_t--; } cout<<"Total passengers served during " <

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3. The group answers the questions.

Answered: 1 week ago