// These are methods we wrote in class that return values. import java.util.*; // so that I can use Scanner public class ReturnMethods { public static void main(String[] args) { // using the Math class System.out.println("10 to the 4th = " + Math.pow(10, 4)); // constraining a number between 0 and 40 int age = -5; age = Math.max(age, 0); System.out.println("age = " + age); age = 57; age = Math.min(age, 40); System.out.println("age = " + age); // using our methods that return values double circleArea = area(4); System.out.println("area of circle with radius 4 = " + circleArea); System.out.println("area of circle with radius 7 = " + area(7)); System.out.println("body temperature (c) = " + fToC(98.6)); } // returns the area of the circle with the given radius public static double area(double radius) { double a = Math.PI * radius * radius; return a; } // returns the Celsius equivalent to the given Fahrenheit temperature public static double fToC(double degreesF) { return 5.0 / 9.0 * (degreesF - 32); } }