file named A2.java. Place all your code in this file.
method with the following header:
public static boolean answerCell(boolean isMorning, boolean is Mom, boolean isAsleep)
Define it as follows:
Your cell phone rings. Return true if you should answer it. Normally you answer, except in the
morning you only answer if it is your mom calling. In all cases, if you are asleep, you do not answer.
answerCell(false, false, false) →true
answerCell(false, false, true) →false
answerCell(true, false, false) →false
method
with the following header: public static int loneSum(int a, int b, int c)
Define it as follows:
Given 3 int values, a b c, return their sum. However, if one of the values is the same as another of the values, it does not count towards the sum.
loneSum(1, 2, 3) →6
loneSum(3, 2, 3) →2
loneSum(3, 3, 3) →0
method with the following header:
public static int blackjack(int a, int b)
Define it as follows:
Given 2 int values greater than 0, return whichever value is nearest to 21 without going over.
Return 0 if they both go over.
blackjack(19, 21) →21
blackjack(21, 19) →21
blackjack(19, 22) →19
sect
sec
sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. LoremsecteUnlock access to this and over
10,000 step-by-step explanations
Have an account? Log In
sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque d
sectetur adipiscing elit. Nam lacinia pulvi