You are here:



could u pls help mi.i realli need your help.i started to write the program,but i nt sure whether is right or wrong.could u give mi an advise.i realli desperate for your help.i will be so appreicated for your help.

#include <iostream> //iostream
#include <cstdlib> //stdlib
#include <ctime> //time

using namespace std;

void enqueue(int);  
int main()
  int random_email;


    for(int i=0; i<random_email; i++)
       cout << random_email - i << endl;

  return 0;
void enqueue(int random_email)

Write an e-mail simulator that processes mail at an average of 40 messages per minute. As messages are received, they are placed in a queue. For the simulation, assume that the messages arrive at an average rate of 30 messages per minute. Remember, the messages must arrive randomly, so you will need to use a random number generator to determine when messages are received.

Each minute, you can dequeue up to 40 messages and send them.
Assume that 25% of the messages in the queue cannot be sent in
any processing cycle. Again, you will need to use a random number
to determine whether a given message can be sent. If it cannot be
sent, put it back at the end of the queue or enqueue it.
Run the simulator for 10 to 15 minutes, tracking the number of
times each message had to be requeued. At the end of the
simulation, print the statistics that show:
1. The total messages processed
2. The average arrival rate
3. The average number of messages sent per minute
4. The average number of messages in the queue in a minute
5. The number of messages sent on the first attempt, the number
sent on the second attempt, and so forth
6. The average number of times messages had to be requeued (do
not include the messages sent the first time in this average.)

Hi dear Jenny !

  Ive answered the same question just yesterday, kindly follow the link given below
hope it would help u ,Get back to me for additional support.

Thank and Regards!
Prince M. Premnath


All Answers

Answers by Expert:

Ask Experts


Prince M. Premnath


Years of research in C/C++ Will bring you all facts regarding , OOPS , SVGA , MOUSE , BIOS , IVT , Feel free to query me :-)


More than 5 years


©2017 All rights reserved.