Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2 Write a Java program that reads radius (r) and height (h) of a cone (a shape like given below figure), and calculates its

image text in transcribed
Question 2 Write a Java program that reads radius (r) and height (h) of a cone (a shape like given below figure), and calculates its volume using the below given formula. (You should define T as 3.14.) rah Volume cone = 3 Note: Radius and height values might be decimal numbers. Therefore, you should get these values from user by using nextDouble() method. Analyze the sample given below and write your codes accordingly. Ilread the value of radius System.out.print("Radius of the cone: "); r = keyboard.nextDouble(): Note: You must use casting conversion to print the volume as an integer. Sample Output: Radius of the cone: 8 Height of the cone: 12 Volume of the cone is 8e3. Volume of Cone

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions