title: Passing a input value from one method to another
body: <p>The following code is for a lab for the java course I'm taking for which just started the chapter on parameters and objects. I've hit a major choke-point past which I can't get past.</p>
  
  <p>The issue I'm having is that I need to get the input assigned to destinationAmount, in the method GetAmountOfDestinations, to the method GetItinerary so I can use it in the for loop. I can't have any code within the main method other than the calls to the other methods. I cannot change the nature of the methods as the instructions say they must be made in a certain way. </p>
  
  <p>Just how would I get the input to the other method? Do I create a third method to route the value through? I've looked for hours on this website and youtube and I haven't seen anything like this situation. I'd appreciate the help.</p>
  
  <pre><code>import java.util.*;
  public class TripPlanner
  {
    public static final Scanner CONSOLE = new Scanner ( System.in );
    public static void main(String [] args)
    {
      GetAmountOfDestinations();
      GetItinerary();
    }
    public static int GetAmountOfDestinations()
    {
      System.out.println( "Please enter the amount of destinations." );
      int destinationAmount = CONSOLE.nextInt();
      System.out.println( "You entered " + destinationAmount + "." );
    }
    public static void GetItinerary() 
    {
  
      System.out.println( "Your starting airport is SAT." );
  
      int amountOfDestinations = ??????;
      System.out.println(amountOfDestinations);
  
      double currentDestinationLatitude = Airports.getAirportLatitude( "SAT" );
      double currentDestinationLongitude = Airports.getAirportLongitude( "SAT" );
      for( int x = 0; x &lt;  amountOfDestinations; x = x + 1 )
      {
        System.out.println( "Please enter the next destination." );
        String nextDestination = CONSOLE.next();
  
        double nextDestinationLatitude = Airports.getAirportLatitude( nextDestination );
        double nextDestinationLongitude = Airports.getAirportLongitude( nextDestination );
  
        System.out.println( nextDestinationLatitude + " " + nextDestinationLongitude );
      }
    }
  }
  </code></pre>