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

+36 votes

I am confused why the initial boolean value impacts the returned boolean value even when the hour is the same.

asked in CSC285_Fall2018 by (8 points)

4 Answers

+24 votes

The boolean 'talking' describes if the parrot is making noise or not, so it does matter. If it is false and the parrot is not talking then the hour doesn't even matter. Only when 'talking' is true does the hour come into play.

answered by (1.3k points)
+22 votes

It depends on whether the parrot is talking because if the parrot is talking, then you could be in trouble depending on the hour. You can be in the hours where you could be in trouble, but if the parrot is not talking, you are not in trouble. Don't forget your boolean operators!

answered by (8 points)
+20 votes

The initial Boolean value is important because it tells you if the parrot is talking or not. If it's before 7 and after 20 and the parrot is not talking then you are not in trouble. If it's in the range of those hours and the parrot is talking, then you are in trouble.

answered by (1.9k points)
+20 votes

I think the returned value should both depends on the hour and the boolean value "talking"

answered by (8 points)
...