title: Calling results from methods outside main into variables in the main method
body: <p>My homework is to calculate taxes and surcharges for a jewelry store that is replenishing its stock, and I have run into a slight snag. I am using a method called calcExtraTax three times to calculate the labor rate and state and federal taxes. I then need to take the results of each instance of that method and pass the value into the appropriate variable in my main method. This is what my code looks like right now (evidently not complete):</p>
  
  <pre><code>import java.text.DecimalFormat;
  import java.util.Scanner;
  import javax.swing.JOptionPane;
  
  public static void main(String[] args)
  {
  
  double stateRate = 0.1;
  double luxuryRate = 0.2;
  double laborRate = 0.05;
  double extraCharge;
  int numOrdered;
  double diamondCost;
  double settingCost;
  double baseCost;
  double totalCost;
  double laborCost;
  double stateTax;
  double luxuryTax;
  double finalAmountDue;
  
      Scanner keyInput = new Scanner(System.in);
  
      System.out.println("What is the cost of the diamond?");
      diamondCost = keyInput.nextDouble();
      System.out.println("What is the cost of the setting?");
      settingCost = keyInput.nextDouble();
      System.out.println("How many rings are you ordering?");
      numOrdered = keyInput.nextInt();
  
      baseCost = diamondCost + settingCost;
      calcExtraCost(baseCost, laborRate);
      laborCost = extraCharge;
      calcExtraCost(baseCost, stateRate);
      stateTax = extraCharge;
      calcExtraCost(baseCost, luxuryRate);
      luxuryTax = extraCharge;
      totalCost = baseCost + laborCost + stateTax + luxuryTax;
      finalAmountDue = numOrdered*totalCost;
      JOptionPane.showMessageDialog(null, "The final amount due is = " + finalAmountDue);
  }
  public static void calcExtraCost(double diamond, double rate)
  {
      double extraCharge = diamond*rate;
      ???????????
  }
  </code></pre>
  
  <p>what i'm trying to figure out is what else i need to put in my secondary method in order to be able to pass the result into a different tax cost variable each time depending on the rate variable used in the formula.</p>