Question: Submit Chapter4.java with two (or more) public static methods for solutions to the following: Know that just getting the return, name, and parameters correct will
Submit Chapter4.java with two (or more) public static methods for solutions to the following:
Know that just getting the return, name, and parameters correct will achieve partial credit, so at least get those submitted in a Class with the correct name (and your name in header comment(s))
A. Write a method called medianOf3 that returns the median (middle) of three integer values. Examples shown below.
if ( medianOf3(3,1,2) == 2 ) score+=5; // plus more tests if ( medianOf3(-2, 817, -6) == -2 ) score+=5;
B. Write a method called reverseStutter that accepts a String parameter and returns that String with its characters reversed AND each repeated twice. Examples shown below:
if ( reverseStutter("12345").equals("5544332211" )) score+=5; // plus other testing... if ( reverseStutter("STOP").equals("PPOOTTSS" )) score +=5;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
