I think my issue is in line 18. The program runs just fine, but my answer isn't correct when I enter a radius and height. Not sure what I am doing wrong here.
import java.util.Scanner;
import java.text.DecimalFormat;
public class ConeA
{
public static void main (String[] args)
{
double surface;
Scanner scan = new Scanner (System.in);
System.out.print ("Enter the radius: ");
double radius = scan.nextDouble();
System.out.print("Enter the height: ");
double height = scan.nextDouble();
surface = Math.PI * radius * Math.pow(radius, 2) + Math.pow(height, 2);
DecimalFormat fmt = new DecimalFormat ("0.##");
System.out.println("The surface area of the cone is: " +
fmt.format(surface));
}
}