Instructions
package edu.buffalo.cisspputyouruseridhere;
File: Cube.java
Description: This class creates an instance of the Cube
class and prints its area and volume.
Requirements:
Create cube objects. The size of each of the cubes
should be input from the keyboard
hint: study the code below
Print the Side length, Surface area and Volume to the
user's screen console for each of the cubes
The program should catch input error exceptions and
deal with them in a reasonable manner
@author putyournamehere
import java.util.Scanner;import java.io;
public class Cube
Hint: put your class variables and objects here
For example the Scanner statement as a 'static' object
Create the getLength method to accept input and verify it is
numeric and greater than zero
Create the calculateSurfaceArea method
Create the calculateVolume method
main creates instances of Cube and calculates the surface area and volume
public static void mainString args throws IOException
int length;
HINT: input the side from the keyboard and check for errors and exceptions
Cube cube new Cube;
System.out.printlnSide length of cube is cubegetLength;
System.out.printlnSurface Area of cube is cubecalculateSurfaceArea;
System.out.printlnVolume of cube is cubecalculateVolume;
Hint add two more cube instances
Don't forget to close your Scanner object
end main
end Cube
When you have this Assignment ready for me to view and grade, you should upload your Cube.java file.