title: Convert temperature from Celsius to Fahrenheit using 3 functions
body: <p>I'm new to java and I'm trying to write a program that converts Celsius to Fahrenheit </p>
  
  <pre><code>import java.util.Scanner;
  
  public class Temps
  {
  
     public static void main(String[] args) 
     {
  
        System.out.print("Enter temp(70 f or 20 c): ");
        double  temp = keyboard.nextDouble();
        String units = keyboard.next();
        if (units.equal("f"))
           newtemp =  ftoc(temp);
        else if (units.equals("c"))
           newtemp = ctof(temp);
        else System.err.println("units must be c or f");
     }
  
            public static double ftoc (int c)
            return (( 5.0 / 9.0) * (c - 32));
         }
  
         public static double ctof (int f)
         {
            return ((9.0/5.0)* f+32);
         }
      }
  </code></pre>
  
  <p>can someone explain to me what I did wrong.</p>