Computer Science, asked by shuklarinki555, 10 months ago

java program to calculate volume of cube and cuboid. (Please send clear and correct answer)


shuklarinki555: pls send fast

Answers

Answered by eswarvts
2

Surface Area of a Cube as per the formulas.

JAVA CODE

// Java Program to find Volume and Surface Area of Cube

package SurfaceAreaPrograms;

import java.util.Scanner;

public class VolumeOfCube {

private static Scanner sc;

public static void main(String[] args) {

// LSA = Lateral Surface Area of a Cube, SA = Surface Area

float length, SA,Volume, LSA;

sc = new Scanner(System.in);

System.out.println("\n Please Enter the Length of any side of a Cube : ");

length = sc.nextFloat();

SA = 6 * (length * length);

Volume = length * length * length;

LSA = 4 * (length * length);

System.out.format("\n The Surface area of a Cube = %.2f", SA);

System.out.format("\n The Volume of a Cube = %.2f", Volume);

System.out.format("\n The Lateral Surface area of a Cube = %.2f", LSA);

}

}


shuklarinki555: no surf area only volume
eswarvts: u can create with this
eswarvts: try it
eswarvts: plz make me brainliest
Similar questions