Computer Science, asked by munnachoudhary8777, 9 months ago

Write a menu driven program (switch case and default ) for volume of cuboid V=LBH

Answers

Answered by abhay25102004
1

Here it is

import java.util.*;

public class volume

{

public static void main(String args[])

{

int V = 0, L,B,H; int choice

Scanner obj = new Scanner (System.in);

System.out.println("Enter your choice \n 1. find the volume");

switch (choice)

{

case 1 :

System.out.println("Enter Length, breadth and height simultaneously");

L = obj,nextInt();

B = obj.nextInt();

H = obj.nextInt();

V += L*B*H;

System.out.println("The volume is = " + V);

break;

default :

System.out.println("Entered choice is wrong");

}

}

Similar questions