Given 3 int values, a b c, return their sum. However, if any of the values is a teen -- in the range 13..19 inclusive -- then that value counts as 0, except 15…
Sign up now. It's free!
See the full question with its answer and worked solution.
For this problem, we'll round an int value up to the next multiple of 10 if its rightmost digit is 5 or more, so 15 rounds up to 20. Alternately, round down to…
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 one of b or c is "close" (differing from a by at most 1), while the other is "far", differing from both other values by…
Sign up now. It's free!
See the full question with its answer and worked solution.
Given three ints, a b c, one of them is small, one is medium and one is large. Return true if the three values are evenly spaced, so the difference between…
Sign up now. It's free!
See the full question with its answer and worked solution.
We want make a package of goal kilos of chocolate. We have small bars (1 kilo each) and big bars (5 kilos each). Return the number of small bars to use,…
Sign up now. It's free!
See the full question with its answer and worked solution.
Vehicles are classified based on their total interior volume. The classify method is intended to return a vehicle classification String value based on total…
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.