0

Need help please!!! Entry by age.

Visitor can enter if 12 year's old. If not, can not. If under 12 years old, can only go with an accompanied. Only comparison can be used. Without if/else. Thanks for your help.

16th Apr 2019, 1:57 PM
Sergey Korzh
Sergey Korzh - avatar
2 Respostas
+ 1
bool canEnter(int age) { return (age<12)? false : true; }
17th Apr 2019, 7:46 AM
Alexander Velinov
Alexander Velinov - avatar
0
Thanks Aleksandar.
18th Apr 2019, 4:40 PM
Sergey Korzh
Sergey Korzh - avatar