I have the following code. I am learning methods and need to create a separate method so I can call a method that will calculate the area of the regular hexagon based on the input ( the side given ).
import java.util.*; public class HexagonAreaCalculator { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Enter the side of a hexagon"); double side = input.nextDouble(); float area = (float) ((( 3 * Math.pow(3, .5) * Math.pow(side, 2))) / 2); if (side == 0) System.out.println("Nope uh uh u can't do that"); else System.out.println("The area is " + area); } //public static float hexArea(float a) { //} }