# Python Buffer simulation

Page 1 of 1

## 0 Replies - 350 Views - Last Post: 18 October 2013 - 03:40 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=331879&amp;s=8c100e78230b558d6487b9d2f5b81342&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 allstarpro

Reputation: 0
• Posts: 1
• Joined: 18-October 13

# Python Buffer simulation

Posted 18 October 2013 - 03:40 PM

Assume the following:
a. Disk spooling is NOT being used.
b. The printer does NOT have a hardware buffer to hold the output while the printer is printing
(The theme music from Mission Impossible is playing faintly in the background).
SIMULATE the following scenario
A hypothetical program computes for three seconds then outputs a variable length record to be printed. The printer takes from 0.75 to 4.75 seconds (average time is 2.75 seconds) to print each output record. (Use a random number generator)
The hypothetical program loops 500 times for each case of software buffers (0, 1, 2, 3, 4, 5, 10, 25, and 100 software output buffers). Calculate the AVERAGE time for the program to “virtually compute and print” a record from the 500 records, for EACH of the 9 choices of buffer. Plot the results. The Y axis is from zero to 8 seconds, and the X axis is nonlinear and displays all nine cases of buffers.

Yes this is a homework assignment, no I do not want the answer.

I'm looking for a general idea of what is supposed to go on in this problem. That is all.

Hope you can help.

Thank you.

Is This A Good Question/Topic? 0

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }