Computer Science, asked by anmolnehra72, 2 months ago

Write a menu driven program to find the following using switch construct to find the following: volume of sphere

Answers

Answered by sritharina4617
2

Answer:

import Java. until. Scanner;

class choice

{

public static void main()

{

System. out. println ("press 1 for cube\npress2 for cuboid");

Scanner SC = new Scanner(System.in);

int a=sc.nextInt();

switch(a)

{

case 1:

System. out. println ("Enter the length of cube");

int l=sc.nextInt();

System. out. println ("volume is "+(l*l*l));

break;

case 2:

System. out. println ("Enter the length,breadth and height");

int ll=sc.nextInt();

int b=sc.nextInt();

int h=sc.nextInt();

System. out. println ("volume is"+(ll*b*h));

break;

default:

System. out. println ("invalid choice ");

}

}

}

Explanation:

stay bless

Answered by KanchiSarath17
2

Answer:

above answer is correct please mark the above answer as brainliest

Similar questions