Write a menu driven program to calculate the volume of a cube,cuboid or cylinder taking the required input from the user.
Using scanner class.
Answers
Answer:
Volume Of Cuboid : Java Program In 3 Simple Ways
Java program to calculate the volume of a cuboid. We can find the value of cuboid in so different ways. We do written the code in 3 different ways check out the table of contents so that you will get an idea. If you have any doubts related to the following java program to find the volume of cuboid, then do comment our dedicated team will help you out.
Table of contents :
Java Program To Total Surface Area Of Cuboid | Programs
Before we explain the code, a couple of lines about cuboid and math formula to find the volume.
What is Cuboid?
A: Convex Polyhedron which was bounded by 6 Quadrilateral Faces.
What is the Formula To Find the Volume of Cuboid?
A: Finding the volume is quite easy. Simple formula Is L X B X H. Most of the code will be base on the following Formula. Do check out 

Sample Program # 1:
[wp_ad_camp_3]
Here Goes the Sample Program if you know the basics then skip the explanation part and move on to the second sample program to find the volume of a cuboid. # Do check out the Online execution and compiler tool just after the code.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.util.Scanner;
class VolumeOfCuboid
{
public static void main(String args[])
{
Scanner s= new Scanner(System.in);
System.out.println("Enter the length of Cubiod:");
double l=s.nextDouble();
System.out.println("Enter the breadth of Cubiod:");
double b=s.nextDouble();
System.out.println("Enter height of Cubiod:");
double h=s.nextDouble();
double volume= l*b*h;
System.out.println("Volume Of Cuboid is:" +volume);
}
}