title: How to assign a variable to the return statement of a static method?
body: <p>I cant seem to get the value of the second method please teach me how I'm still a beginner at this. Do I have to use a different variable? And if so how do I assign the return value of that method to the said variable? </p>
  
  <pre><code>import java.util.Scanner ;
  
  class JavaChip
  {
  
      static Scanner s = new Scanner(System.in) ;
      static double val ;
  
  
      public static void main( String[] args )
      {
          displayLine () ;
          System.out.print ("Enter number of cups of Mocha JavaChip: ");
          val = getMocha( s.nextDouble() ) ;
          System.out.print ("The grams of mocha is: " + val ) ;
  
          System.out.print ("\nThe grams of sugar is: " + val ) ;
          displayLine () ;
      }
  
      static double getMocha ( double c )
      {
          return ( 1.215 * c ) ;
      }
  
      static double getSugar (double c)
      {
          val = ( 0.15 * c ) ;
          return val ;
      }
  
      static void displayLine()
      {
          System.out.println("\n\n[][][][][][][][][][][][][][][][][][][]") ;
          System.out.println("[][][][][][][][][][][][][][][][][][][]") ;
      }
  
  }
  </code></pre>