
Develop the program calculateCylinderArea, which accepts radius of the cylinder's base disk and its height and computes surface area of the cylinder.

Hi Friend,
Try the following code:
import java.util.*;
import java.text.*;
class CalculateCylinderArea
{
public static void main(String[] args)
{
DecimalFormat df = new DecimalFormat("##.00");
double pi=3.14;
Scanner input=new Scanner(System.in);
System.out.print("Enter Radius: ");
double r=input.nextDouble();
System.out.print("Enter Height: ");
double h=input.nextDouble();
double v1=2*pi*r*r;
double v2=2*pi*r*h;
double surfaceArea=v1+v2;
System.out.println("Surface Area of Cylinder: "+df.format(surfaceArea));
}
}
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.