title: Why are my variables returning null and or 0 when using different classes?
body: <p>My problem is when I run the code, the variables being accessed by the final print statement is returning them as null and or 0's.</p>
  
  <p>Here is my code.<br>
  <strong>SammysContrusct</strong>
  package program7;</p>
  
  <pre><code>import java.util.Scanner;
  public class SammysContract {
  Scanner userInput = new Scanner(System.in); 
  static  String  contractID,rental;
  
  static  int     minutes,hours;
  
  static  double  totalCost;
  
  public void printWelcome()
  {       
      System.out.println("Welcome back to Sammy's Rentals! Now introducing new prices and contracts!");   
  }
  
  public String inputContract()
  {
      System.out.print("Please enter your contract ID: ");
      String contractID = userInput.nextLine();       
      return contractID;      
  }
  
  public String rentalItem()
  {       
      System.out.print("What would you like to rent? ");
      String rentalItem = userInput.nextLine();       
      return rentalItem;      
  }
  
  public int hourID()
  {       
      System.out.print("How many hours would you like to rent it for? ");
      int hours = userInput.nextInt();        
      return hours;       
  }
  
  public int minuteID()
  {       
      System.out.print("How many minutes would you like to rent it for? ");
      int minutes = userInput.nextInt();      
      return minutes;     
  }
  
  public double calculateRate()
  {       
      if (hours &lt; 3)
      {           
          totalCost = hours * 35; 
  
      }
      else if (hours &gt;= 3 | hours &lt;=5)
      {
  
          totalCost = hours * 30;
  
      }
      else if (hours &gt;= 5 | hours &lt;=7)
      {
  
          totalCost = hours * 25;
  
      }
      else if (hours &gt; 7)
      {           
          totalCost = hours * 20;         
      }
      else
      {           
          System.out.print("Please enter a valid number.");           
      }
  
      return totalCost;       
  }
  
  public double calculateCost()
  {       
      totalCost = hours + minutes;
      System.out.printf("The contract ID %s has specified %s for %d hours and %d minutes will equate to %.2f", contractID, rental, hours, minutes, totalCost);
  
      return totalCost;       
  }   
  </code></pre>
  
  <p>}</p>
  
  <p><strong>SammysRentalsV2</strong>
  package program7;</p>
  
  <p>//Main Method ~ Driver Class</p>
  
  <p>public class SammysRentalsV2 {</p>
  
  <pre><code>public static void main(String[] args)
  {
  
      SammysContract contracts = new SammysContract();
  
      contracts.printWelcome();
      contracts.inputContract();
      contracts.rentalItem();
      contracts.hourID();
      contracts.minuteID();
      contracts.calculateCost();      
  }   
  </code></pre>
  
  <p>}</p>