Question
Hello, I need help writing a short JAVA program that can implement Round Robin processing , and also provide avg. turnaround time and avg response
Hello, I need help writing a short JAVA program that can implement Round Robin processing, and also provide avg. turnaround time and avg response time. Below I have typed up the criteria/hints for the type of program I am looking for. Suppose for testing, the processes are A:(0,20), B:(0,10), C:(0,40), D:(0,20). I was hoping to have it in this format of a Process class and Scheduler class, so two separate classes.
What I know so far is that an array and a for-loop need to be implemented. Each process must make progress towards completion. The processes should get scheduled one after an other, typical to round robin. Once a process is complete, it should no longer be considered into the scheduling process. After the processes are all finished, the program should end and have a print statement with the following info: total time, avg. turnaround time and avg. response time. Your help/time will be greatly appreciated!! Comments would also be helpful!!
To implement the problem we need a representation for each process, the scheduler logic, and the calculation logic for response time and turnaround time. Devise a class for Process that holds the data needed to describe a process and to allow calculating the required times: public class Process // variables for duration, time of arrival, // constructor // methods: which ones are helpful? We also need a representation of the scheduler: public class Scheduler // the 5 processes according to the 'analysis' document private Processll procs new Process(new Process(0, 10), new Process(o, 20),h // constructor, methods, etc. // main to pull it togetherStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started