Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+17 votes
asked in CSC211_Winter2018 by (8 points)

1 Answer

+6 votes

It is easy to make your code redundant when returning or setting a boolean value, so you must be cautious. Because a boolean can exist in one of two states, "true" or "false", there are many occasions where you only need to write code that checks when the boolean is either true or false, not both. This is because if the boolean isn't true, it must be false, and vice versa.

answered by (8 points)
...