FCFS
FCFS
h>
using namespace std;
struct process{
int id;
int arrivalTime;
int burstTime;
int waitingTime;
int turnaroundTime;
};
currentTime += processes[i].burstTime;
}
}
findWaitingAndTurnAroundTime(processes);
int main(){
int n;
cout<<"enter the number of processes: ";
cin>>n;
vector<process> processes(n);
for(int i=0; i<n; i++){
processes[i].id = i+1;
cout<<"enter the arrival time of process "<<i+1<<": ";
cin>>processes[i].arrivalTime;
cout<<"enter the burst time of process "<<i+1<<": ";
cin>>processes[i].burstTime;
}
findAverageTimes(processes);
}