1. Engineering
  2. Computer Science
  3. hello i rlly need help writing a short java program...

Question: hello i rlly need help writing a short java program...

Question details

HELLO I RLLY NEED HELP, writing a short JAVA program that can implement Round Robin processing, and also provide avg. turnaround time and avg response time. Please ONLY POST an answer if it is what is specified, I have been trying to figure this problem out for a couple of weeks and I have been only getting copy/paste answers!! Below I have typed up the criteria/hints for the type of program I am need help developing. 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!! Please only post an answer if it is what is specified, I have been trying to figure this problem out for a couple of weeks and I have been getting copy/paste answers!!

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 together

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution