SurfaceAreaOfCube.java
/* 
* Program that functions to compute the surface area of a cube. 
* -The edge length will be read from the standard input stream. 
* -The surface area will be printed to the the standard output stream. 
* -A face of the cube will be modeled as a simple square 
 */


package mathematics;

import java.util.Scanner;
import shapes.SSquare;

public class SurfaceAreaOfCube {

    public static void main(String[] args) {
        double edglength = edgelength();
        double surfaceArea = surfaceArea(edglength);
        System.out.println("surface area = " + surfaceArea);
    }

    private static double edgelength() {
        System.out.println("Please enter the edge length of the cube: ");
        Scanner scanner = new Scanner(System.in);
        double edgeLength = scanner.nextDouble();
        return edgeLength;
    }

    private static double surfaceArea(double edgeLength) {
        SSquare face = new SSquare(edgeLength);
        int nrOfFaces = 6;
        double surfaceArea = face.area() * nrOfFaces;
        return surfaceArea;
    }
}