Question: Problem 1 Sum the Intervals Write a program that prompts the user to enter the lower and upper bounds of n intervals, finds and prints

Problem 1 Sum the Intervals Write a program that prompts the user to enter the lower and upper bounds of n intervals, finds and prints the sum of the n intervals. The sum of two intervals is defined as in the following [a, b] + [c, d [a + b, c+ d) Sample input/output: Enter the number of intervals: 5 Enter the lower and upper bounds of the interval: 3 7 Enter the lower and upper bounds of the interval: 1 9 Enter the lower and upper bounds of the interval: 2 4 Enter the lower and upper bounds of the interval: 5 7 Enter the lower and upper bounds of the interval: 7 18 The sum of the 5 intervals is [18, 45]. c++ code block

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!