title: How do we use a variable from one method to another for eg im trying divide one variable by another
body: <p>I'm trying to divide variables from pointsearned and creditsearned method in the pointsaverage method but it gives "Your grade point average isNaN" when i run it , how do i fix this ?(I'm a beginner)</p>
  
  <pre><code>public class JavaApplication40 {
  static Scanner keyboard = new Scanner(System.in);
  
  public static void main(String[] args) {
     double credits = 0;
     double Points = 0;
     double average = 0;
  
     IDnumber();
      CreditsEarned(credits);
      PointsEarned(Points);
      System.out.println("Your grade point average is" +  PointAverag(average, Points, credits));
  }
  public static void IDnumber(){
    String docNuMBER; 
      System.out.println("Enter your student ID number ");
      docNuMBER = keyboard.nextLine();
  
  }
  
  public static double CreditsEarned( double credits){
      double NumCreditsEarned;
      System.out.println("Enter your Credit hours earned");
      NumCreditsEarned = keyboard.nextDouble(); 
      return NumCreditsEarned;
  }
  
  public static double PointsEarned(double points){
     double NumberOpoints;
     System.out.println("Enter your credit points");
     NumberOpoints = keyboard.nextDouble();
     return NumberOpoints;
  }
  public static double PointAverag(double grade , double NumberOpoints ,
          double NumCreditsEarned) {
     double average ;
      average =   NumberOpoints/NumberOpoints;
      return average ;
  </code></pre>