Cpu scheduling program in c++ The program will help "HOW TO INTERACT Cpu scheduling program in c++" Code : #include #include #include class cpuschedule { int n,Bu[20]; float Twt,Awt,A[10],Wt[10],w; public: //Getting the No of processes & burst time void Getdata(); //First come First served Algorithm void Fcfs(); //Shortest job First Algorithm void Sjf(); //Shortest job First Algorithm with Preemption void SjfP(); //Shortest job First Algorithm with NonPreemption void SjfNp(); //Round Robin Algorithm void RoundRobin(); //Priority Algorithm void Priority(); }; // Implementation file for Cpu scheduling #include "cpuh.h" //Getting no of processes and Burst time void cpuschedule::Getdata() { int i; cout<<" Enter the no of processes:"; cin>>n; for(i=1;i<=n;i++) { cout<<" Enter The BurstTime for Process p"<>Bu[i]; } } //First come First served Algorithm void cpuschedule::Fcfs() { int i,B[10]; Twt=0.0; for(i=1;i<=n;i++) { B[i]=Bu[i]; cout<<" Burst time for process p"<B[i] && S[i]=='T') { min=B[i]; j=i; } i++; } i=j; if(w==Time && start[i]=='T') { w=w+B[i]; S[i]='F'; } else { Wt[i]=Wt[i]+w; w=w+B[i]; S[i]='F'; } } cout<<"Weight info "; for(i=1;i<=n;i++) cout<<" WT["<>ch; switch(ch) { case 1: c.Getdata(); break; case 2: cout<<"FIRST COME FIRST SERVED SCHEDULING "; c.Fcfs(); break; case 3: cout<<"SHORTEST JOB FIRST SCHEDULING "; do { cout<<"1.SJF-Normel "; cout<<"2.SJF-Preemptive "; cout<<"3.SJF-NonPreemptive "; cout<<"Enter your choice "; cin>>cho; switch(cho) { case 1: c.Sjf(); break; case 2: c.SjfP(); break; case 3: c.SjfNp(); break; } }while(cho<=3); break; case 4: cout<<"ROUND ROBIN SCHEDULING "; c.RoundRobin(); break; case 5: cout<<"PRIORITY SCHEDULING "; c.Priority(); break; case 6: break; } }while(ch<=5); }