Programming Assignment 2: C++

Assigned: March 24
Due: April 7

A scheduling problem consists of a collections of jobs, which must be executed on a processor. In particular, a schedule S is an assignment of each job to run from a start time to an ending time. (Assume that jobs cannot be interrrupted.) A schedule is correct if it satisfies constraints of various kinds.

In one simple variant of the problem, each job J as an associated length J.Length. The ending time of J in a given schedule is equal to the start time plus the length. The schedule must satisfy the constraint that no two jobs overlap; that is, for any two jobs J1 and J2, it cannot be true that the start time of J1 precedes the end time of J2 and the start time of J2 preceded the end time of J1.

Other features of a job might include a release time with the associated constraint that the job may not start earlier than the release time; a due time with the associated constraint that the job may not end later than the due time; and a set of predecessor jobs with the constraint that, if J1 is a predecessor of J2, then the end time of J1 cannot be later than the start time of J1.

The file schedSketch.cpp contains the skeleton of a C++ program that:

Your job is to complete the code so that it runs correctly.

Note in particular:

Grading

Code that does not compile gets no more than 1 point out of 10.
Correctly working code gets at least 9 points out of 10. The remaining point is for elegant coding and adequate commenting.
Code that compile but does not always work correctly get partial credit. Of course, the methods have to work correctly on examples other than the particular ones in "main".

Submission

Email your C++ source code to Samantha.