
import static java.lang.System.*;

public class HelpMethods 
{
  
  // Method add will receive two values.
  // The first value will be put in variable a.
  // The second value will be put in variable b.
  // a and b are called parameters.
  // They are local to this method only.
  // The method creates the variables and
  // then assigns the incoming values to the
  // variables.
  // For example:  add(7, 8) would 
  // create variable a and assign it 7.
  // create variable b and assign it 8.
  // The method would return 15.
  // The variables will be destroyed when
  // the method ends.
  public static int add(int a, int b)
  {
     return a + b;
  }
  
  public static int mult(int a, int b)
  {
     return a * b;
  }

  public static int go(int a, int b, int c, int d)
  {
     return add(a,b) + mult(c,d);
  }

  public static void main(String[] args) 
  {
       
  out.println("Help with Methods");
  out.println();
  out.println();
  
  // Calling method add from above
  out.println("Calling method add");
  out.println("==================");
  // 2 is sent to variable a
  // 4 is sent to variable b
  out.println("add(2, 4) is  " + add(2, 4));   
  
  // -2 is sent to variable a
  // 8 is sent to variable b
  out.println("add(-2, 8) is " + add(-2, 8));   
  out.println();  
  
  // Calling method mult from above
  out.println("Calling method mult");
  out.println("==================");
  out.println("mult(2, 4) is  " + mult(2, 4));   
  out.println("mult(-2, 8) is " + mult(-2, 8));   
  out.println();
  
  // Calling method go from above
  out.println("Calling method go");
  out.println("==================");
  out.println("go(2, 4, 6, 8) is  " + go(2, 4, 6, 8));   
  out.println("go(-2, 8, 4, 5) is " + go(-2, 8, 4, 5));   
  out.println();
  
  
  } // end of main method
  
} // end of class HelpMethods


