Answer:
bool isSquare = (width == height) ? true : false;
Step-by-step explanation:
The code above has been written using C++ language.
Assumptions and notes:
i. The width and height variables have been defined.
ii. The conditional operator ? : is used
The format of the conditional operator ? : is as follows;
(expression) ? xxx : yyy
Where;
==> expression is the condition to test. In this case whether width and height are equal. i.e width == height
==> xxx is the returned value or function if the expression is true. In our case, the value is the boolean true.
==> yyy is the returned value or function if the expression is false. In our case, the value is the boolean false.
And finally;
The returned value is assigned to a bool variable called isSquare
Putting all these together gives;
bool isSquare = (width == height) ? true : false;