# Programming Assignment Please note that variations of this problem have been posted online before. None of them are correct. That is why I’m getting help here.

Programming Assignment

Please note that variations of this problem have been posted online before. None of them are correct. That is why I’m getting help here.

1.  Write a C/C++ program that creates a table consisting of 2,000 randomly generated 3- tuple entries where each entry consists of processID, arrivalTime, and burstTime. The processID should be a “unique” 4-digit positive integer (e.g., 3862, 8871, 9239, etc.). The arrivalTime should be an integer randomly picked from a range of values between 1 and 1,250. Note that the arrival times of two processes can be the same. The burstTime is an integer randomly picked from a range of values between 1 and 750. Your program should print out the table. An example output of your program would look something like this:

processID    arrivalTime   burstTime

8391             1                        83

2283             4                        20

1024             3                        30

2.  Based on the code for Problem 1, write a C/C++ program that simulates execution of the first come first served (FCFS) algorithm and calculates the average waiting time. If the arrival times are the same use the unique processID to break the tie by scheduling a process with a smaller ID first. Run this program 2,000 times. Note that each time you run this program, a new table should be generated, and thus, the average waiting time would be different. An example output would look like this:

Average waiting time for FIFO

12.2

13.3

15.2

3.  Based the code for Problems 1 and 2, write a C/C++ program that simulates execution of the preemptive shortest job first (SJF) algorithm. If the arrival times are the same use the unique processID to break the tie by scheduling a process with a smaller ID first. If the

burst time is the same, use the FCFS algorithm to break the tie. Run this program 2,000 times. Note that each time you run this program, a new table should be generated, and thus, the average waiting time would be different. An example output would look like this:

Average waiting time for Preemptive SFJ

11.1

9.3

8.2

4.  In this problem, you will compare the performance of the two algorithms in terms of the average waiting time. Therefore, your program should calculate the average waiting times for both algorithms. For each table generated in Problem 1, run both algorithms and compute the average waiting time for each algorithm. Repeat this 1,000 times. An example output would look like this.

FIFO     SJF

10.1     9.1

19.1     12.3

20.4     15.2

5. Write a report that analyzes and compares the performance of the two algorithms. In your analysis, include a graph that visually represents the performance difference. For example,

WILL ATTACH GRAPH

Also write a paragraph that analyzes the performance difference. For example, “the mean average waiting time of the preemptive SFJ was … and the standard deviation was … The preemptive SJF performs better than FCFS by X% in terms of the average waiting time. The reason is that …”

Files to submit:

A SEPARATE .C FILE FOR EACH QUESTION

A SEPARATE .DOCX FILE FOR Q5

## Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
\$26
The price is based on these factors:
Number of pages
Urgency
Basic features
• Free title page and bibliography
• Unlimited revisions
• Plagiarism-free guarantee
• Money-back guarantee
On-demand options
• Writer’s samples
• Part-by-part delivery
• Overnight delivery
• Copies of used sources
Paper format
• 275 words per page
• 12 pt Arial/Times New Roman
• Double line spacing
• Any citation style (APA, MLA, Chicago/Turabian, Harvard)

# Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

### Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

### Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

### Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

### Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

error: Content is protected !!