Question: Problem 1 ( Two Intervals ) Write a program called two intervals.cpp that accepts a ( float ) , b ( float ) , d
Problem
Two Intervals
Write a program called
two
intervals.cpp
that accepts
a
float
b
float
d
float and
c
float as commandline arguments.
The two numbers
a
and
b
represent endpoints of a closed interval
a b
when
a
b
or
b a
when
a b
on real number line.
The two numbers
c
and
d
represent endpoints of a closed interval
c d
when
c
d
or
d c
when
c d
on real number line.
Your program will verify then concludes whether or not these two intervals instersect each
other.
Also, your program must display the message Requires arguments to run! if the user
passed less than arguments when running the program.
Here are some example outputs when running the program from a terminal.
workspacecschw
$
go outtwointervals.out srctwointervals.cpp
$
outtwointerval.out
Requires arguments to run!
$
outtwointerval.out
The interval intersects with
$
outtwointerval.out
The interval intersects with
$
outtwointerval.out
The interval does not intersect
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
