1 package mathematics; 2 import java.util.Scanner; 3 import shapes.SSquare; 4 5 public class SurfaceAreaOfCube { 6 7 8 public static void main(String[] args) 9 { 10 double edgeLength=edgeLength(); 11 double surfaceArea=surfaceArea(edgeLength); 12 System.out.println("surface area ="+surfaceArea); 13 } 14 15 private static double edgeLength() 16 { 17 System.out.print("Please enter the edge length of the cube: "); 18 Scanner scanner=new Scanner(System.in); 19 double edgeLength=scanner.nextDouble(); 20 return edgeLength; 21 } 22 private static double surfaceArea(double edgeLength) 23 { 24 SSquare face=new SSquare(edgeLength); 25 int nrOfFaces=6; 26 double surfaceArea=face.area()*nrOfFaces; 27 return surfaceArea; 28 } 29 } 30