Write a menu driven program to find the following using switch construct to find the following: volume of sphere
Answers
Answered by
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
2
Answer:
above answer is correct please mark the above answer as brainliest
Similar questions
Environmental Sciences,
1 month ago
Math,
1 month ago
Social Sciences,
2 months ago
Math,
2 months ago
Math,
9 months ago
Math,
9 months ago