Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a C++ program where you will use nested loops to solve a system of linear inequalities, given limits on the domains of x and

Create a C++ program where you will use nested loops to solve a system of linear inequalities, given limits on the domains of x and y. Your program should use this system of inequalities: 2x-y < 4 and x + 3y > 1 Given these inequalities, your program should take four values as input: xLow, xHigh (both integers) - Limits on the domain of x yLow, yHigh (both integers) - Limits on the domain of y Your program should use nested for loops to extend the x value from xLow to xHigh and to extend y from yLow to yHigh, in increments of one unit for each variable. For each pair (x, y) check the system of inequalities for a valid solution; if the values of x and y result in a true value for both inequalities, the (x, y) pair satisfies the system. If the (x, y) pair satisfies the system, output the pair to the screen.

Test Case #1:

Enter your x limits (low  high): 1 5 Enter your y limits (low  high): 2 7 (1, 2) (1, 3) (1, 4) (1, 5) (1, 6) (1, 7) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6) (2, 7) (3, 3) (3, 4) (3, 5) (3, 6) (3, 7) (4, 5) (4, 6) (4, 7) (5, 7) 

Test Case #2:

Enter your x limits (low  high): 3 4 Enter your y limits (low  high): 4 5 (3, 4) (3, 5) (4, 5) 

Test Case #3: Change your inequalities to be y < cos(x) and sin(x) > y.

Enter your x limits (low  high): 0 4 Enter your y limits (low  high): 0 4 (1, 0) 

Test Case #4: Use the inequalities from Test Case #3.

Enter your x limits (low  high): 1 5 Enter your y limits (low  high): 1 5 There are no solutions. 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

=+j on to staff their operations in the global marketplace.

Answered: 1 week ago