public class MyProgram { public static double min ( double s, double r ) { double m = 0; if ( s < r ) { m = s; // s is the smaller value } else { m = r; // r is the smaller value } return(m); // Output of the method } public static void main(String[] args) { double r; r = min( 1.0, 4.0 ); System.out.println(r); r = min( 3.7, -2.9 ); System.out.println(r); r = min( -9.9, 3.8 ); System.out.println(r); } }