Using C++ write a program that will simulate FCFS, SJN, SRT, and round robin sch
ID: 3566597 • Letter: U
Question
Using C++ write a program that will simulate FCFS, SJN, SRT, and round robin scheduling algorithms. For each algorithm, the program should compute waiting time and turnaround time of every job as well as the average waiting time and average turnaround time. The average values should be consolidated in a table for easy comparison. You may use the following data to test your program. The time quantum for round robin is 4 milliseconds. (assume that the context switching time is 0). Job Arrival Time CPU Cycle (in milliseconds) A 0 16 B 3 2 C 5 11 D 9 6 E 10 1 F 12 9 G 14 4
Explanation / Answer
here is the required code but please mark as "BEST" and rate my answer
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
class cpuschedule
{
int n,bu[20];
float twt,awt,wt[20],tat[20];
public:
void Getdata();
void fcfs();
void sjf();
void roundrobin();
};
//Getting no of processes and Burst time
void cpuschedule::Getdata()
{
int i;
cout<<
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.