PART 1: PSEUDO-CODE Let J be a set of jobs that need to be processed on a single
ID: 3750681 • Letter: P
Question
PART 1: PSEUDO-CODE Let J be a set of jobs that need to be processed on a single machine. Let pi and di be the processing time and due date of job j in J. Assume the following inputs: j - 0, 1, 2, 3, 4, 51 P [10, 3, 4, 8, 10, 61 d [15, 6, 9, 23, 20, 30] due dates jobs (index) processing times Problem 1-20 points Develop a pseudo-code that reads the lists j, p and d as inputs and prints the number of jobs that are completed late if the jobs are processed in non-decreasing order of their index (i.e. 012 >..).Explanation / Answer
A pseudocode means a human readable code that there are no strict conventions to the write this code.
begin
p=[10,3,4,8,10,6];
d=[15,6,9,23,20,30];
sum:=0;
count:=0;
for i:=0 to 5 do
begin
sum:=sum+p[i];
if sum>d[i] then
count:=count+1
end
return count
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.