Answered step by step
Verified Expert Solution
Question
1 Approved Answer
My code:The volume is 125.6637 Correct code:The volume is 125.6640 4. Cylinder Base Area and Volumn saved The following is a sample run: 3.5 20.6
My code:The volume is 125.6637
Correct code:The volume is 125.6640
4. Cylinder Base Area and Volumn saved The following is a sample run: 3.5 20.6 Enter the radius and length of a cylinder: The base area is 38.4846 The volume is 792.7828 1 Full Screen Cylinder.Java New 1- import java.util.Scanner; public class Cylinder { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter the radius and length of a cylinder: "); double radius = in.nextDouble(); double length = in.nextDouble(); double area = Math.PI * radius * radius; double volume = Math.PI * radius * radius * length; System.out.printf("The base area is %.4f ", area); System.out.printf("The volume is %.4f ", volume); 16 17 } }Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started