Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!!

image text in transcribed

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions