Assignment title: Information
Question 1:
Name: "input1.txt"
The format will be:
Line 1: Process numbers, in the order in which process arrive at time 0. Though they all arrive at time 0, their relative order matters for some of the algorithms.
Line 2 to line n + 1: the Burst Time followed by the Priority of the process, separated by a space. Where n is the number of processes, as stated in the first line of the file.
It should look something like this:
1 2 3 4 5
3 2
1 4
3 1
2 3
1 5
Question 2:
Name: "input2.txt"
Line 1: Number of processes, as an integer.
Line 2 to line n + 1: Where n is the number of processes. The information about the process (i), priority, burst, then arrival space delimited.
It should look something like this:
4
40 20 0
30 25 25
30 25 30
35 15 60
For question 3 and Question 4, you can essentially answer them in one program, if the input in generalized, which it should be.
Question 3:
You may assume a static number of processes (5) and a static number of resources (4).
Name: "input3.txt"
Line 1: Available resources
Line 2 to line n+1: Where n is the number of processes. The resources the processes have currently (the allocation) and the resources they need (the max)
Line n+2: The available resources
Line n+3: a blank line
Line n+4 and onward: A process request, such as in 7.3 part c. The process making the request, followed by the amount of each resource they want. You should continually process these lines until there are none left. Output whether or not the request can be granted. Do not allow these requests to impact the system, they are purely theoretical. Answer CAN the request be granted, do not actually grant the request.
It should look something like this:
1 5 2 0
0 0 1 2 0 0 1 2
1 0 0 0 1 7 5 0
1 3 5 4 2 3 5 6
0 6 3 2 0 6 5 2
0 0 1 4 0 6 5 6
0 1 5 2 0
1 4 5 2 0
Question 4:
You may assume a static number of processes (5) and a static number of resources (4).
Name: "input4.txt"
Line 1: Available resources
Line 2 to line n+1: Where n is the number of processes. The resources the processes have currently (the allocation) and the resources they need (the max)
Line n+2: The available resources
Line n+3: a blank line
Line n+4 and onward: A process request, such as in 7.3 part c. The process making the request, followed by the amount of each resource they want. You should continually process these lines until there are none left. Output whether or not the request can be granted. Do not allow these requests to impact the system, they are purely theoretical. Answer CAN the request be granted, do not actually grant the request.
It should look something like this:
1 5 2 0
0 0 1 2 0 0 1 2
1 0 0 0 1 7 5 0
1 3 5 4 2 3 5 6
0 6 3 2 0 6 5 2
0 0 1 4 0 6 5 6
0 1 5 2 0
1 4 5 2 0