Last active
November 19, 2020 03:24
-
-
Save dcbriccetti/195cd7217ad60678d693646af3c1445b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HasTeen { | |
public static boolean hasTeen(int a, int b, int c) { | |
return (a >= 13 && a <= 19) || (b >= 13 && b <= 19) || (c >= 13 && c <= 19); | |
} | |
public static void main(String[] args) { | |
assert hasTeen(13, 20, 10); | |
assert hasTeen(20, 19, 10); | |
assert hasTeen(20, 10, 13); | |
assert !hasTeen(20, 10, 10); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment