// Name : Matthew Reeves // This is a program to calculate math functions import java.util.Scanner; public class mdreeves_Math { public static void main ( String args[] ) { Scanner input= new Scanner ( System.in ); double x; System.out.print("Please enter a number: "); x=input.nextDouble(); System.out.printf("Math.ceil(%.3f) = %.3f\n", x, Math.ceil(x)); System.out.printf("Math.abs(%.3f) = %.3f\n", x, Math.abs(x)); System.out.printf("Math.floor(%.3f) = %.3f\n", x, Math.floor(x)); System.out.printf("Math.log(%.3f) = %.3f\n", x, Math.log(x)); System.out.printf("Math.pow(%.3f,%.3f) = %.3f\n", x,x, Math.pow(x,x)); System.out.printf("Math.sqrt(%.3f) = %.3f\n", x, Math.sqrt(x)); } }