Question: Please pass this link; https://codecheck.it/files/1810061902aej4bdgjv8o0p55rtqyix1obd /** * Logic Functions * Problem Setb * @author * @version */ public class 09 { /** * Write the
Please pass this link; https://codecheck.it/files/1810061902aej4bdgjv8o0p55rtqyix1obd
/** * Logic Functions * Problem Setb * @author * @version */ public class 09 { /** * Write the method named evenlySpaced(). * * 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 small and medium is the * same as the difference between medium and large. * * Examples: * evenlySpaced(2, 4, 6) returns true * evenlySpaced(4, 6, 2) returns true * evenlySpaced(4, 6, 3) returns false * * @param a the first number. * @param b the second number. * @param c the third number * @return true if the numbers meet the conditions described. */ // TODO - Write the evenlySpaced method here. /** * Write the method named luckySum(). * * Given 3 int values, a b c, return their sum. * However, if one of the values is 13 then it * does not count towards the sum and values * to its right do not count. So for example, * if b is 13, then both b and c do not count. * * Examples: * luckySum(1, 2, 3) returns 6 * luckySum(1, 2, 13) returns 3 * luckySum(1, 13, 3) returns 1 * * @param a the first number. * @param b the second number. * @param c the third number * @return the lucky sum as calculated here. */ // TODO - Write the luckySum method here. /** * Write the method named makeBricks(). * * We want to make a row of bricks that is goal * inches long. We have a number of small bricks * (1 inch each) and big bricks (5 inches each). * Return true if it is possible to make the * goal by choosing from the given bricks. * * Examples: * makeBricks(3, 1, 8) returns true * makeBricks(3, 1, 9) returns false * makeBricks(3, 2, 10) returns true * * @param small number of small bricks. * @param big number of big bricks. * @param goal number of bricks desired in row. * @return true if possible with available bricks. */ // TODO - Write the makeBricks method here }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
