Demonstrate proficiency in defining and invoking functions with parameters and return values by solving practical math and logic problems.
These challenges are language-agnostic, meaning they can be completed in any programming language. Make sure to use the proper conventions for your chosen language.
return statements to send values back to the caller void and non-void functions correctly inchesToCm() that takes one float or double parameter
parameter (inches) and returns the equivalent length in centimeters.
max() that takes two integer parameters and returns the larger of the two values.
circleArea() that accepts a
float or double parameter radius parameter and returns
the area of a circle using
Math.PI.
isEven() that accepts an
integer and returns true if it's even
or
false if it's odd.
toCelsius() that converts a
float or double parameter Fahrenheit temperature to
Celsius using the formula
(F - 32) * 5 / 9.
averageOfThree() that accepts
three
float or double parameter parameters and returns their
average.
Inches to Centimeters: 12.7Max of (8, 3): 8Area of Circle (r=3): 28.27Is 7 even? false98.6°F in Celsius: 37.0Average of (5, 7, 9): 7.0