Question

Java Using NetBean Given a cylinder with radius of 5 and height of 8, write a...

Java Using NetBean

Given a cylinder with radius of 5 and height of 8, write a program to calculate the volume of this cylinder. You need to define a constant value PI in your program.

0 0
Add a comment Improve this question Transcribed image text
Answer #1


import java.util.Scanner;
class Main
{
static final double PI=3.14;//constant defined
public static void main(String args[])
{   

int radius=5,height=8;
double volume=PI*radius*radius*height;
System.out.println("volume of Cylinder is: " +volume);
}//main ends here
}//class ends here

Add a comment
Know the answer?
Add Answer to:
Java Using NetBean Given a cylinder with radius of 5 and height of 8, write a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT