Computer Science, asked by priyankagupta331985, 4 months ago

write a program in java when SAR=2*(lb+bh+lh)​

Answers

Answered by lalitnit
0

Answer:

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

package SurfaceAreaPrograms;

import java.util.Scanner;

public class VolumeOfCuboid {

private static Scanner sc;

public static void main(String[] args) {

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

float length, width, height, SA, Volume, LSA;

sc = new Scanner(System.in);

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

length = sc.nextFloat();

System.out.println("\n Please Enter the Width of a Cuboid : ");

width = sc.nextFloat();

System.out.println("\n Please Enter the Height of a Cuboid : ");

height = sc.nextFloat();

SA = 2 * (length * width + length * height + width * height);

Volume = length * width * height;

LSA = 2 * height * (length + width);

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

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

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

}

}

Similar questions