• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

need help writing a boolean expression

stickybytes

Golden Member
I need help writing the following boolean expressions given these conditions:

Fill in the spaces marked with ____ to complete the following Boolean expressions. Do not use the Boolean operator "!" in your answer. Write only in the spaces marked with ____. Assume that X, Y and Z are integer variables.

An expression that is true if X is strictly the largest of the three variables X, Y and Z. For example, if X is 50, Y is 40 and Z is 45, the expression should be true, but if X is 50, Y is 40, and Z is 50, the expression should be false, since X is not strictly greater than Z.


(______) _____ (______)

An expression that is true if X is is one of the largest of the three variables X, Y and Z. For example, if X is 50, Y is 40 and Z is 50, the expression should be true.

(______) _____ (______)

thanks.
 
You want us to do your homework? 😉

Seriously, this is easy stuff. What are you trying to place in?

For what it's worth, the test authors have just made it hard for you by using phrases like "strictly the largest of" and "one of the largest of."

I'll give you a hint: where he writes "strictly the largest of" you write "x > ?" where ? is replaced by the other variables in the set. You'll have to use logical AND (&& in C, C++, and C#) to group individual boolean expressions into a larger test.

Where he writes "one of the largest of" you write "x >= ?" where ? is replaced by the other variables in the set. Again you will need logical AND to group subexpressions.
 
Back
Top