Jason Hart1,089 Points
Quiz Question - Bob's Three Kids
For the "Using Logical ORs and ANDs" quiz, one of the questions is:
If Bob is 50, has 3 children, and works for a software company, what is the answer to this logical statement: age > 30 || children < 3 || isEmployed
The answer the quiz is looking for is True.
I thought it would be False as the number of his children (3) is equal to, not less than 3.
In Java, do you have to specify "less than or equal to" or does < account for that?
Dan Johnson40,525 Points
In Java you use <= to specify less than or equal to. The result is true since only one condition has to be true for the entire expression to be true when using logical OR.