1 package Math; 2 3 import shapes.SSquare; 4 import java.util.Scanner; 5 6 public class Surfaceareaofcube { 7 public static void main(String[] args){ 8 double edgeLength = edgeLength(); 9 double surfaceArea = surfaceArea(edgeLength); 10 System.out.println("Surface Area = "+surfaceArea); 11 } 12 13 private static double edgeLength(){ 14 System.out.println("Enter the edge length: "); 15 Scanner sca = new Scanner(System.in); 16 double edgeLength = sca.nextDouble(); 17 return edgeLength; 18 } 19 private static double surfaceArea(double edgeLength) { 20 SSquare face = new SSquare(edgeLength()); 21 int facecount = 6; 22 double surfaceArea= face.area()*facecount; 23 return surfaceArea; 24 } 25 } 26