wap a menu driver program or switchcase to find area or perimeter of a circle and area and perimeter of a square
Answers
Answered by
1
class ab
{
public static void main (int a,int r,int ch)
{
switch(ch)
{
case 1:
areacircle = 22/7×Math.pow(r,2);
pmcircle = 2×22/7×r;
System.out.println(areacircle);
System.out.println(pmcircle);
break;
case 2:
areasq = Math.pow(a,2);
pmsq = 4*a;
System.out.println(areasq);
System.out.println(pmsq);
break;
default :
System.out.println("WRONG CHOICE");
}
}
}
If this helps u then only mark as brainliest.
{
public static void main (int a,int r,int ch)
{
switch(ch)
{
case 1:
areacircle = 22/7×Math.pow(r,2);
pmcircle = 2×22/7×r;
System.out.println(areacircle);
System.out.println(pmcircle);
break;
case 2:
areasq = Math.pow(a,2);
pmsq = 4*a;
System.out.println(areasq);
System.out.println(pmsq);
break;
default :
System.out.println("WRONG CHOICE");
}
}
}
If this helps u then only mark as brainliest.
Similar questions
Social Sciences,
7 months ago
Geography,
7 months ago
Math,
7 months ago
English,
1 year ago
Computer Science,
1 year ago