Help with a programming problem: Talking Parrot & Alerts

We have a loud talking parrot. The “hour” parameter is the current hour time in the range 0…23. We are in trouble if the parrot is talking and the hour is before 7 or after 20. Return true if we are in trouble

Please suggest me the code.

Is this a programming exercise from the course?

No, it is out of course.