Write an e-mail simulator that processes mail

Assignment Help Computer Engineering
Reference no: EM131981352

Assignment

Task for this assignment is to investigate some of the properties of queues.

Queues are commonly used in network systems. For example, e-mail is placed in queues while it is waiting to be sent and after it arrives at the recipient's mailbox. A problem occurs, however, if the outgoing mail processor cannot send one or more of the messages in the queue. For example, a message might not be sent because the recipient's system is not available.

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 time arrival rate, that is, the average number of messages arriving per minute
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 1st attempt, the number sent on the 2nd attempt, and so forth
6. The average number of times messages had to be requested (do not include the messages sent the first time in this average)

PS: My lecturer have given us some hint stated below, strongly advised to follow the hint he have given

Everything to be completed using Java
Name of the program: QueueSim.java

Hint

• In some cases where the email account is full, it will rejoin the queue to attempt to send the email again
• Each loop = 1 minute (use loop to stimulate the time)

while (stimulationCount < 15 [use as a parameter that user can specify] )

NumOfEmailArrive = generate a random number between 0 to 60

Add the newEmail to the queue

• 1 minute - can have 1, 2 or even 30 messages coming in
• The above statement generates the number of email arrive in a minute

NumOfEmailDequeue = generate a random number between 0 to 40

NumofemailtobeDueqeue = min (queueSize, NumOfEmailDequeue)

Loop for NumOfEmailtobeDequeue
Generate a random number between 0 to 100
If number is < 25
(0 / 60) / 2 =30

• To do no.5 and no.6, use ArrayOfCount to compute.

Reference no: EM131981352

Questions Cloud

How many families must be served to clear break-even point : Greg Morrison recently graduated from construction engineering school. how many families must be served to clear the break-even point?
How to motivate and inspire different generations : In today's workplace managers must learn how to motivate and inspire different generations to be successful.
Consolidation of positions or reductions in workforce : Often companies undergo mergers and acquisitions. These mergers and acquisitions often lead to the consolidation of positions or reductions in workforce.
Strategic knowledge base in organization : Critically discuss the above statement in relation to effectively developing the strategic knowledge base in YOUR organization.
Write an e-mail simulator that processes mail : 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.
Bond outstanding-what is the price of the bond : Riordan Inc. has a bond outstanding that has a $1,000 par value, semiannual coupon rate of 4% and a current yield of 7.9%. What is the price of the bond?
Organization development and change : Organization Development And Change 1. Choose a company for study that has gone through a major recent change, turnaround, renewal or transformation.
Blade manufacturing factory turn out to be defective : Q1. One fifth percent of the blades produced by a blade manufacturing factory turn out to be defective.
Why field of information security considered growth industry : Why is the field of Information Security considered a growth industry? What are the costs associated with an information security breach?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Explain effect on the programmer and the hardware designer

The 68000 has 32-bit address registers that hold bits A00 to A31 However ,the 68000 has only address pins A01 to A23 what are the reasons for this?

  Describe three most prominent risks and respective controls

A payroll department has a time sheet application where employees enter their hours worked. Describe the three most prominent risks and respective controls.

  Deduce a set of boundary-layer differential equations

Starting with the general viscous energy equation, show by a succession of steps how and why it reduces to the classic heat-conduction equation for a solid.

  Time and space complexity

Express the following five loosely explained problems carefully in the form as used in the "Computers and Intractability".

  What are the criteria by which address decoders are judged

What does primary address range mean when it is applied to a system using partial address decoding?

  Senior management action about preventing possible barriers

Make a recommendation to senior management about preventing possible barriers for full implementation and acceptance of the new system

  Determining the bmi

Develop a modular system which determines and display a person’s body mass index (BMI). The BMI is often used to calculate whether a person with the sedentary lifestyle is overweight or underweight for their height.

  Code must be well commented suitable use of control

you have been asked by your manager to create a user-friendly application that will present a survey to your customers.

  Discuss level of importance for all three priorities

Same Level of Importance for all three priorities. The comment column(column E) must be used to justify your selections

  Write an introspective capstone paper expressing your views

write an introspective capstone paper expressing your views aboutinformation use in todays society. this will be

  Encode the given message using the lzw algorithm

Given an initial dictionary consisting of the letters a b r y b, encode the following message using the LZW algorithm: abbarbarraybbybbarrayarbbay.

  Explain the emerging enterprise network applications

Explain the Emerging enterprise network applications and Strategic importance of cloud computing in business organizations.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd