// Interval comparisons // // In engineering, tasks may be scheduled during // intervals of time. Consequently, it may be // necessary to determine whether two intervals // overlap and, if so, for how long. // First, query the user for two floating-point // numbers 'a' and 'b'. If 'a > b', swap the two // values so that 'a <= b' and so that '[a, b]' // defines an interval containing all times 't' // such that 'a ≤ t ≤ b'. // // Repeat this procedure to obtain a second // interval [c, d], again swapping the endpoints // if necessary. // // If the endpoints of either interval are equal, // the interval represents // an instantaneous event. // // Next, you will compare the two closed intervals: // Determine which of the following three cases // applies and display the corresponding message: // 1. If the intervals are disjoint, // so they don't overlap, display to the screen // "The intervals do not overlap." // 2. If the intervals overlap at only one point, // display to the screen // "The intervals overlap at", // the point at which they overlap, // and a closing ".". // 3. If the overlap is itself an interval, // display to the screen // "The intervals overlap from", // the lower bound of the overlap, // the string " to ", // the upper bound of the overlap, // and a closing ", inclusively.". // Function declarations int main(); // Function definitions int main() { return 0; } // Hint: // Consider where an overlap would begin and end: // What would be the first point in the overlap? // What would be the last point? // // What can you determine by comparing these // two points?