Question: I need you to write this code for me. Attached are the requirements. Note: the code should be written in C, not C++ 1 Submission

I need you to write this code for me.

Attached are the requirements.

Note: the code should be written in C, not C++

I need you to write this code for me.Attached are the requirements.Note:the code should be written in C, not C++ 1 Submission Thereis no report template for this lab. Instead, submit the following items:

1 Submission There is no report template for this lab. Instead, submit the following items: 0 20 pts - A PDF with a summary of what you learned in the lab session. This should he no more than two paragraphs. Try to get at the main idea of the lab1 and include any thicular details you found interesting or any problems you encountered. a 80' pts - The source code of your algorithm implementations (Le. a completed schedulingc). 2 Description This project will allow you to explore four different scheduling algorithms: First-Come-First-Servesl, Shortest Remaining Time, Round Robin, and Round Robin with Priority. Download scheduling.c from lanvas. Read through the main function. This program simulates process scheduling. You will implement four scheduling algorithms, described in Section 3, in functions marked by TUDOs. These functions are called at every timestep of the simulation (one simulated seixnid) to determine which simulated process runs next. The scheduling functions accept two parameters: 1. The array of process structures, which contains a variety of information about the parameters and current state of the processes being simulated. See the code for the list of values contained in each process. You may use any of these values in your scheduling algorithm. but you may not modify any of them. The code in main will take care of that for you. 2. The current time of the simulation. You will need to use this to determine which pmcasses are \"ready,\" meaning they have arrived and they have not finished. (Pmcesses do not block for I f 0 in this simulation.) 2.1 Output As the simulation runs, the code in main will print out the following for you: 1. The start time of each process (the time instant when the process fin-rt runs, not each context switch) 2. The end time of each process (the time instant when the process's remaining time drops to zero) 2.1 Output As the sinmlation runs, the code in main will print out the rllowing for you: 1. The start time of each process (the time instant when the process rst runs, not each eontext switch) 2. The end time of each process (the time instant when the process's remaining time drops to zero] After all simulated processes have nished for an algorithm, the average turnaround time (time from anivuime to endtime} is also printed. Sample output for the random seed OXCOFFEE is available on Canvas. Your implementations of Round Robin and Round Robin with Priority may produce slightly different results, depending on the implementation details, but the average turnaround time should be close to the example. 3 Algorithms 3 . 1 void rst _come_rst _served 0 This algorithm simply chooses the process that arrival the earliest and runs it to completion. If two or more processes have the same arrival time, the algorithm should choose the process that has the lowest index in the process array. 3.2 void least_remaining_time() This algorithm chooses the process that has the least remaining execution time left, of those that are ready to run. \"then a new process arrives, it may preempt the currently running process. On a tie, choose the process with the lowest index in the process array. 3.3 void roundrobino This algorithm cycles through the ready processes, running each for a l-second quantum (Le. a single simulation tirnestep) before switclng to the next process. Newly-arrived processes do not necessarily need to go at the end of the \"queue\" to keep your implementation simple, they can simply take their rst turn according to their index in the process array. 3.4 void roundrobin_priority0 This algorithm is the same as basic Rolmd Rollin algorithm, while also accounting for priority. Assume that a larger value of priority (from the process struct] indicates a higher priority. The algorithm cycles between oznlf,r the highest-priority ready processes. For example, if there are processes with priority levels 1 and 2 that are ready, only the processes with priority level 2 are run, either until they have all completed, or until a higher-priority process arrives. If one or more higher-priority processes arrive while lower-priority processes are running, the algorithm imnlediately begins running the higher-priority processes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!