CS1411 Lab Exercise 3 Implementation of CPU Scheduling Policies: FCFS and SJF (Nonpreemptive and Preemptive) solution

$25.00

Original Work ?

Download Details:

  • Name: Assignment-3-8jivzf.zip
  • Type: zip
  • Size: 11.26 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (2 votes)

Lab Exercise 3 Implementation of CPU Scheduling Policies: FCFS and SJF (Nonpreemptive and Preemptive)

Aim:

Develop a menu driven C program to implement the CPU Scheduling Algorithms
FCFS and SJF

Algorithm:

1. Read the following
a. Number of processes
b. Process IDs
c. Arrival time for each process
d. Burst Time for each process

2. Design a menu with FCFS and SJF options

3. Upon selection of menu option apply the corresponding algorithm.

4. Compute the Turnaround Time, Average waiting Time for each of the algorithm.

5. Tabularize the results.

6. Display the Gantt Chart.

Sample Input & Output:

CPU SCHEDULING ALGORITHMS
1. FCFS
2. SJF
3. EXIT
Enter your option: 1
FCFS CPU SCHEDULER
Number of Processes: 5
Process ID: P1
Arrival Time: 0
Burst Time: 4




Process ID: P5
Arrival Time: 6
Burst Time: 3
Output:
Process ID Arrival Time Burst Time Turnaround Time Waiting Time
P1 0 4 *** ***
*** *** *** *** ***
***
***
Average *** ***

Want to Continue ( Y/N): Y
CPU SCHEDULING ALGORITHMS
1. FCFS
2. SJF
3. EXIT

Enter your option: 2
SJF CPU SCHEDULER
a. Non preemptive SJF
b. Pre emptive SJF
Enter your option: a

Number of Processes: 5
Process ID: P1
Arrival Time: 0
Burst Time: 4




Process ID: P5
Arrival Time: 6
Burst Time: 3

Output:
Process ID Arrival Time Burst Time Turnaround Time Waiting Time
*** *** *** *** ***
*** *** *** *** ***
***
***
Average *** ***

🚀 Custom Work, Just for You! 🚀

Can’t find the tutorial you need? No worries! We create custom, original work at affordable prices! We specialize in Computer Science, Software, Mechanical, and Electrical Engineering, as well as Health Sciences, Statistics, Discrete Math, Social Sciences, Law, and English.

✍️ Custom/Original Work Essays cost as low as $10 per page.
💻 Programming Custom Work starts from $50.

🔥 Get top-quality help now! 🔥

Get Your Custom Work