
Hello Sir
I need the code for calculating the area of a cylinder in which it asks radius value from user and then calculate area using this radius value.
Please provide me complete code.
Hope you will not disappoint me.

Dear friend
The code given below is according to your description :
import java.util.Scanner;
import java.text.*;
public class cylinderVolume
{
public static void main(String []args)
{
double radius, area, pi=3.14;
welcomeMessage();
radius = receiveRadius();
area = computeArea(radius);
outputMessage(area);
}
public static void welcomeMessage
{
System.out.println("Welcome to my program! ");
System.out.println("This program will compute the area of a cylinder ");
}
public static double receiveRadius()
{
Scanner input = new Scanner(System.in);
double radius;
System.out.print("Please enter a radius: ");
radius = input.nextDouble();
return radius;
}
public static double computeArea(double radius)
{
double area, pi=3.14;
area = pi * radius * radius;
return area;
}
public static void outputMessage(double a)
{
DecimalFormat num = new DecimalFormat("##.00");
System.out.println("The area is " + num.format);
}
}
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.