SurfaceAreaOfCube.java
1    package Mathematics;
2    // Program that gives you the surface area of the cube by inputting the length.
3    import java.util.Scanner;
4    import shapes.SSquare;
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       private static double edgeLength() {
13           System.out.print("Please enter the edge length of the cube: ");
14           Scanner scanner = new Scanner(System.in);
15           double edgeLength = scanner.nextDouble();
16           return edgeLength;
17       }
18       private static double surfaceArea(double edgeLength) {
19           SSquare face = new SSquare(edgeLength);
20           int nrOfFaces = 6;
21           double surfaceArea = face.area() * nrOfFaces;
22           return surfaceArea;
23           }
24       }
25   
26