Fcfs
Fcfs
class fcfs {
int a[10], k, b[10], c[10], d[10], n, i, j, sum, total;
float awt, atat;
public:
void getdata() {
k = total = sum = 0;
cout << "Enter the number of processes: ";
cin >> n;
b[0] = 0;
void putdata() {
cout << "Process\tBurst time\tWaiting time\tTurnaround time\n";
for(i = 0; i < n; i++) {
cout << d[i] << "\t" << a[i] << "\t\t" << b[i] << "\t\t" << c[i] << "\
n";
}
cout << "Average waiting time: " << awt << "\n";
cout << "Average turnaround time: " << atat << "\n";
}
};
int main() {
fcfs obj;
obj.getdata();
obj.putdata();
return 0;
}