PredefinedMethods2

PredefinedMethods2 - System.out.println"min(15 25 =" min(15 25 System.out.println"min(23.67 14.28 =" Math.min(23.67 14.28

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//Predefined Methods: Examples of Table 7-1 / import static java.lang.Math.*; i public class PredefinedMethods2 { public static void main(String[] args) { System.out.println("abs(-67) = " + Math.abs(-67)); System.out.println("abs(35) = " + abs(35)); System.out.println("abs(-75.38) = " + abs(-75.38)); System.out.println("ceil(56.34) = " + ceil(56.34)); System.out.println("exp(3) = " + exp(3)); System.out.println("floor(65.78) = " + floor(65.78)); System.out.println("log(2) = " + Math.log(2)); System.out.println("log10(2) = " + Math.log10(2)); System.out.println("max(15, 25) = " + max(15, 25)); System.out.println("max(23.67, 14.28) = " + Math.max(23.67, 14.28));
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: System.out.println("min(15, 25) = " + min(15, 25)); System.out.println("min(23.67, 14.28) = " + Math.min(23.67, 14.28)); System.out.println("pow(2.0, 3.0) = " + Math.pow(2.0, 3.0)); System.out.println("pow(4, 0.5) = " + pow(4, 0.5)); System.out.println("round(24.56) = " + Math.round(24.56)); System.out.println("round(18.35) = " + round(18.35)); System.out.println("sqrt(4.0) = " + sqrt(4.0)); System.out.println("sqrt(2.25) = " + sqrt(2.25)); System.out.println("cos(0) = " + cos(0)); System.out.println("sin(0) = " + sin(0)); System.out.println("tan(0) = " + tan(0)); } }...
View Full Document

This note was uploaded on 06/17/2011 for the course COMP 2301 taught by Professor Staff during the Spring '10 term at Kennesaw.

Ask a homework question - tutors are online