Home Segments Top Top Previous Next

410: Practice

Write a method that transforms an athlete's pulse rate into one of three integers: if the rate is less than 60, the value returned by the method is to be -1; if the rate is more than 80, the value returned is to be 1; otherwise, the value returned is to be 0. Then, write another method that transforms an athlete's body fat as a percentage of weight into one of three integers: if the athlete's body-fat percentage is less than 10, the value returned is to be -1; if it is more than 20, the value returned is to be 1; otherwise, the value returned is to be 0.