/**
 * OppositeFinder.java
 * Computer Science S-111
 * 
 * This program demonstrates the use of a method with a parameter
 * and return value, and it also illustrates variable scope.
 */

public class OppositeFinder { 
    public static void main(String[] args) {
        int number = 10;
        int otherNumber = opposite(number);
        
        System.out.print("The opposite of ");
        System.out.print(number);    // this number is still 10
        System.out.print(" is ");
        System.out.println(otherNumber);
    }
    
    /*
     * Returns the opposite of the specified number.
     */
    public static int opposite(int number) {
        number = number * -1;        // this number becomes -10
        return number;
    }
}