- Information
- AI Chat
Was this document helpful?
Assignment 4 - Lecture notes 5
Course: Computer Science (CSC1B)
103 Documents
Students shared 103 documents in this course
University: University of Johannesburg
Was this document helpful?
Computer Science 3A
Practical Assignment 4
10 March 2022
Time: 10 March 2022 Ů 17h00 Marks: 50
Practical assignments must be uploaded to eve.uj.ac.za before 17h00. Late submissions
will not be accepted, and will therefore not be marked. You are not allowed to collabo-
rate with any other student.
You manage to land your Ąrst developer job. Life is good! The problem is that for the
next 6 months or so you are probably going to do a graduate program or do bug Ąxing on
existing systems :( Is it fair? Well many people argue that it makes new developers more
familiar with current systems. Another issue is that some companies explicitly giving bug Ąxes
to newer staff and that may not be fair because these developers would be overloaded. This
practical is all about making that allocation of bug Ąxes more fair in an efficient way.
Every developer has a limited amount of energy to facilitate bug Ąxes and not every de-
veloper is created equal, which results in a difficult problem to resolve. How are they each
allocated fairly? How do we determine what is fair? Enter queues. Their job is to ensure that
each entity gets fair treatment and everything progresses in a linear order.
For this weekŠs practical we are going to deal with this problem in the form of Develop-
ers and BugFixes. Developers perform BugFixes that are allocated to them and use up
energy to perform the Ąx (or a part thereof). You need to implement a Queue-based allocator
that ensures the work of the BugFixes are spread evenly among Developers and the Developers
are not overworked.
You are required to implement the following functions:
•enqueue - that inserts an element into the queue.
•dequeue - that removes an element from the queue.
•front - the methods that returns the front element in the queue.
•allocateDevelopersRandomly - A method that allocates Developers by random and
decreases their energy level by their respective work rate. In every iteration a random
Developer is chosen for work until each BugFix in order is completed. This method
should display the time it took to complete the allocation.
Page 1 of 4