Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners hi... pls give me the example of java coding fo following question
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


raj flavian
hi... pls give me the example of java coding fo following question
1 Answer(s)      3 years and 6 months ago
Posted in : Java Beginners


example java coding that reads in the radius and length of cylinder and computes volume. formula: Area = radius * radius * PI Volume = area * length


Advertisement
View Answers

March 29, 2011 at 5:17 PM


import java.util.*;
import java.text.*;

class CalculateCylinderVolume
{
    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 Length: ");
        double l=input.nextDouble();

        double area=r*r*PI;
        double volume=area*l;
        System.out.println("Volume of Cylinder: "+df.format(volume));
        }
}


Related Tutorials/Questions & Answers:
hi... pls give me the example of java coding fo following question
hi... pls give me the example of java coding fo following question  example java coding that reads in the radius and length of cylinder and computes volume. formula: Area = radius * radius * PI Volume = area * length
hi... pls give me the example of java coding fo following question
hi... pls give me the example of java coding fo following question  Write a java program that reads the following information and prints a payroll statement: Employee‚??s name (e.g: Sam) Number of hours worked in a week (e.g: 10
Advertisements
hi... pls give me the example of java coding for following question
hi... pls give me the example of java coding for following question   Write a program that computes loan payments. The loan can be a car loan, a student loan, or a home mortgage loan. The program lets the user enter the interest
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a program that displays the following table (note that 1 mile is 1.609 kilometers). Miles Kilometers
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a program that prompts the user to enter the number of students and each student‚??s name and score, and finally displays the name of the students
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a program that reads in investment amount, annual interest rate, and number of years, and displays the future investment value using the following formula
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Suppose that the tuition for a university is RM10,000 this year and increases 5% every year. Write a program that computes the tuition in ten years and the total cost
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a function called ChangeToNext that take in an uppercase character parameter ch. The function returns the next uppercase character if ch is between 'A' and 'Y
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a class that contains the following two methods: /* converts from inches... that invokes these methods to display the following table: Inches Centimeters
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Body Mass Index(BMI) is a measure of health on weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters
please give me a java program for the following question
please give me a java program for the following question  Write a java program that displays multiple frames : Step 1: Design a frame with three... is an example that displays three buttons and display another frame when
Please give me coding for this..
Please give me coding for this..  Write an application that inputs one number consisting of five digits from the user.separates the number ibto its individual digits and prints the digits separated from one another by three
pls help me with this question
pls help me with this question  how to write a program in C++ using encapsulation,polymorphism,inheritance and abstraction?(all these concepts should come in a single program
Plz give java coding for this
Plz give java coding for this  ... iMin = 1, iMax = 8, iMid; // give max. value in even no. int jMin = 1, jMax = 12, jMid; // give max. value in even no. iMid = iMax / 2; jMid = jMax / 2
hi see and give me reply as soon as possible
hi see and give me reply as soon as possible  Hi Friend, I got path,but it will again ask path error first i was gave index.jsp.It.../hello) is not available. JBoss Web/2.1.2.GA above error will displayed pls
hi , i cant make this programmer , can any one help me to make it pls - Java Beginners
hi , i cant make this programmer , can any one help me to make it pls   In this exercise we would like to build a system in java ( set of classes...://www.roseindia.net/java/example/java/io/ Thanks  i want to make the whole
Plz give me code for this question
Plz give me code for this question  Program to find depth of the file in a directory and list all files those are having more number of parent directories
pls give me answer ae soon as possible - Ajax
pls give me answer ae soon as possible  i m writing code of ajax technology ...but it is not working pls check it n give me response quickly... give me quick response!!! thanks & regards shashank gupta
give me a grid example in php
give me a grid example in php  give me easy code example of grid in php like mysql editor
please give me an idea to develop a program for this question?
please give me an idea to develop a program for this question?  How to enter a text or number from keyboard without using InputStreamReader method in java
Pls help me with strings
Pls help me with strings  To reverse a every other word in a string. Example :- If the input is "This is a line of message" the output should be "sihT is a line fo message
Pls help me with strings
Pls help me with strings  To reverse a every other word in a string. Example :- If the input is "This is a line of message" the output should be "sihT is a line fo message
pls. help me - Java Beginners
pls. help me  please help me i do need now if its okay...[] list = new int[50]; int[] Alist = new int[60]; int num; Write Java statements that do the following: a. Call the method funcOne with the actual
i have a problem to do this question...pls help me..
i have a problem to do this question...pls help me..  Write a program... with the digits reversed. For example if the input is 12345, the output should be 54321.   Hi Friend, Try this: import java.util.*; public class ReverseNumber
why and where we use setter and getter methods in java, please give me one example program.....
why and where we use setter and getter methods in java, please give me one example program.....  why and where we use setter and getter methods in java, please give me one example program
Hi .Again me.. - Java Beginners
Hi .Again me..  Hi Friend...... can u pls send me some code...... REsponse me..  Hi friend, import java.io.*; import java.awt....://www.roseindia.net/java/example/java/swing/ Thanks.  I am sending running code
Can you give me a simple Hibernate Sessionfactory example?
Can you give me a simple Hibernate Sessionfactory example?  Hi, I would like to get session instance from the SessionFactory interface in Hibernate 4. Can you give me a simple Hibernate Sessionfactory example for the above
please help me to give code - Java Beginners
please help me to give code  Write a program that reads a file named... of a tie, you may print out only one of them. For example in the file: Alan Turing... print out John von Neumann   hi friend, import java.io.*; import
Can you give me Hibernate one to one example?
Can you give me Hibernate one to one example?  Hello there, Can you give me a hibernate one to one example that explain the concept and mapping in Hibernate. Thanks in advance
please help me to give code - Java Beginners
please help me to give code  Write a program that prints an n-level... and the number of stairs in the stair case * ** *** ****   Hi friend..., http://www.roseindia.net/java
pls help me it urgent
pls help me it urgent  hey, pls help me i want to know that can we call java/.bat file from plsql/proceudre /trigger
Advertisements
 

 

 

DMCA.com