I have this project where I create a program that calculates the area of a rectangular prism. I am suppose to print the results in printf this is what I have... is it correct?
instructions ;
importjava.util.Scanner;
publicclassChapter6ProjectFirstTry
{
publicstaticvoidmain(String[] args)
Scanner input =newScanner(System.in);
System.out.print("Enter the Length: ");
doublelength =input.nextInt();
System.out.print("Enter the Width: ");
doublewidth = input.nextInt();
System.out.print("Enter the Height: ");
doubleheight = input.nextInt();
doubletotal = 2*(length * width)+2*(height*length)+2*(height*width);
System.out.print%f("The total Surface area for the rectangle prism is " +length+ " inches long, " +width+ " inches wide, and " +height+ " inches tall " + total + " square inches. ");
}
Thank you
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here