// This simple example of methods is due to TA David Allen
// augmented/edited by M. Branicky (10/07/06)

public class SimpleMethods
{// begin of class SimpleMethods


    public static void main(String args[])
    {// begin of main method

        // the adder(5,3) is the METHOD CALL to the method you have written
        System.out.println("five plus three is " + adder(5,3));

        // note the similarity to a METHOD CALL to a method in the Math library
        System.out.println("five cubed is " + Math.pow(5.,3.));

        // the multiplier(5,3) is the METHOD CALL to another method you have written
        multiplier(5,3);

    }// end of main method


    // takes two int's as parameters; returns an int value equal to their sum
    public static int adder(int a, int b)
    {// begin of adder method

        return a + b;

    }// end of adder method


    // takes two int's as parameters; prints product and doesn't return anything
    public static void multiplier(int a, int b)
    {// begin of multiplier method

        int product;     // local variable, only available in multiplier method
        product = a*b;
        System.out.println( a + " times " + b + " is " + product );

    }// end of multiplier method

}// end of class SimpleMethods
