Given a string str, if the string starts with "f" return "Fizz". If the string ends with "b" return "Buzz". If both the "f" and "b" conditions are true, return…
Sign up now. It's free!
See the full question with its answer and worked solution.
Given an int n, return the string form of the number followed by "!". So the int 6 yields "6!". Except if the number is divisible by 3 use "Fizz" instead of the…
Sign up now. It's free!
See the full question with its answer and worked solution.
Given three ints, a b c, return true if b is greater than a, and c is greater than b. However, with the exception that if "bOk" is true, b does not need to be…
Sign up now. It's free!
See the full question with its answer and worked solution.
Given three ints, a b c, return true if they are in strict increasing order, such as 2 5 11, or 5 6 7, but not 6 5 7 or 5 5 7. However, with the exception that…
Sign up now. It's free!
See the full question with its answer and worked solution.
Given three ints, a b c, return true if two or more of them have the same rightmost digit. The ints are non-negative. Note: the % "mod" operator computes the…
Sign up now. It's free!
See the full question with its answer and worked solution.
Return the sum of two 6-sided dice rolls, each in the range 1..6. However, if noDoubles is true, if the two dice show the same value, increment one die to the…
Sign up now. It's free!
See the full question with its answer and worked solution.
Given two int values, return whichever value is larger. However if the two values have the same remainder when divided by 5, then the return the smaller value.…
Sign up now. It's free!
See the full question with its answer and worked solution.
You have a red lottery ticket showing ints a, b, and c, each of which is 0, 1, or 2. If they are all the value 2, the result is 10. Otherwise if they are all…
Sign up now. It's free!
See the full question with its answer and worked solution.
AP® and Advanced Placement® are registered trademarks of the College Board, which is not affiliated with, and does not endorse, Verityprep. Names are used for identification purposes only.