The Math2 ClassLet's begin the development process by defining a skeleton version of the Math2 class. At the top of the class goes the declaration to place the Math2 class in the TechJava.MathLib package. We are going to define six methods in the class. The log10() method will compute the base 10, or common, logarithm. The logX() method will compute the logarithm of a number according to a user -specified base. The next three methods will calculate hyperbolic trigonometric values. The final method will compute a higher transcendental function known as the gamma function. package TechJava.MathLib; public class Math2 { public static double log10(double a) { } public static double logX(double a, double b) { } public static double sinh(double a) { } public static double cosh(double a) { } public static double tanh(double a) { } public static double gamma(double a) { } } In the following sections we will implement each method in the Math2 class. |