java code 7

java code 7

Develop the program calculatePipeArea. It computes the surface area of a pipe, which is an open cylinder. The program accpets three values: the pipes inner radius, its length, and the thickness of its wall.

View Answers

December 24, 2010 at 12:33 PM

Hello Friend,

Try the following code:

import java.util.*;
class CalculatePipeArea{
    public static void main(String[] args) 
    {
        double PI=3.14;
        Scanner input=new Scanner(System.in);
        System.out.print("Enter Inner Radius: ");
        double r=input.nextDouble();
        System.out.print("Enter Length: ");
        double h=input.nextDouble();
        System.out.print("Enter thickness: ");
        double d=input.nextDouble();
        double R=d+r;
        double area1=2*PI*r*h;
        double area2=2*PI*R*h;
        double a=Math.pow(R,2)-Math.pow(r,2);
        double area3=2*PI*a;
        double surfaceArea=area1+area2+area3;
        System.out.println(surfaceArea);

    }
}

Thanks

Ads









Related Tutorials/Questions & Answers:
java code 7
java code 7  Develop the program calculatePipeArea. It computes the surface area of a pipe, which is an open cylinder. The program accpets three...; Hello Friend, Try the following code: import java.util.*; class
Java 7 Language Fundamentals
This tutorial describes basic language features of Java 7
Advertisements
Data Types in Java 7
In this section we will discuss Java 7 Data Types
Operators in java 7
This tutorial describes the concept of operators in java 7
Arrays in java 7
This tutorial describes the concept of Arrays in java 7
Difference between Java 6 and Java 7
Java 6 and Java 7. To know the basic difference between Java 6 and Java7, let us... in the Java 6. Java version 7: Java Version SE 7was launched on July 28, 2011... Handling. Difference between Java 6 and Java 7: In terms of the features, Java 6 has
Logical Operators in java 7
In this tutorial, we are going to discuss about logical operator in java 7
java classpath prbm in windows 7
java classpath prbm in windows 7  i have a problem to set... that user variables i set them like this: CLASS .;C:\Program Files\Java\jdk1.6.0_32\lib; in system variables PATH .;C:\Program Files\Java\jdk1.6.0_32\bin; after
Java SE 7
Java SE 7 Java SE was released on 28 July 2011. Its code name is Dolphin. It was first launched on 7 July 2011 but made available to general public on 28... is the list of new features added to the Java 7 : Java Virtual Support
Continue Statement in java 7
Continue Statement in java 7 In this tutorial we will discuss about continue statement in java 7. Continue Statement : Sometimes you need to skip block... statement in loops. In java 7, Continue statement stops the current iteration
Switch Statement in java 7
Switch Statement in java 7 This tutorial describes the if statement in java 7. This is one kind of decision making statement. Switch Statements... to 7 to assign days value Monday, Tuesday...up to Saturday. We have written
If statement in java 7
If statement in java 7 This tutorial describes the if statement in java 7... : In java, you can use nested if statements that means you can write... : In java, you can use multiple if-else statements as well as Else-If statements
Break Statement in java 7
Break Statement in java 7 In this tutorial we will discuss about break statement in java 7. Break Statement : Java facilitate you to break the flow... java provides the way to do this by using labeled break statement. You can jump
For Loop Statement in java 7
For Loop Statement in java 7 In this section, we will discuss about for loop in java 7. This is one type of  loop statement. For Loop Statements : For loop is one way of looping to iterate block of code under certain condition
Expressions, Statements, and Blocks in java 7
In this section we will discuss expressions, Statements and Blocks in java 7. This is one type of Language Fundamentals
Looping Statements in java 7
Looping Statements in java 7 In this section, we will discuss about Looping Statements in java 7. This is one type of control flow statement. Looping... to repeat block of code under particular condition. It is single line
While Loop Statement in java 7
While Loop Statement in java 7 This tutorial, helps you to understand the concept of while loop  in java 7. While Loop Statements : While loop... Hello 5 Hello 6 Hello 7 Hello 8 Hello 9 Hello 10
Branching Statements in java 7
Branching Statements in java 7 In this section, we will discuss about Branching Statements in java 7. This is one type of control flow statement. Branching... statement provided by the java 7. Its functionality to stop the current
Java 7 Features
Java 7 is the latest version of Java programming language launched on 7th July.... The additional features that characterize Java 7 are listed below. Java virtual... bytecode translated from a Java program. In Java 7, support for dynamically typed
Java Enterprise Edition 7 (JEE7): Features and Specifications
Java Enterprise Edition 7 (JEE7): Features and Specifications The latest version of Java Enterprise Edition (JEE) called JEE 7 was recently launched by the Oracle and the Java Community Process (JCP) members along with Java EE 7
Installing Java (JDK 7) on Windows 7 Computer Video Tutorial
"Welcome to the world of Java programming". This video tutorial shows you how to download and configure JDK 7 on your windows 7 computer. To learn the Java... JDK 7 on your computer. To make your computer ready for Java Programming you
Maven dependency for com.groupbyinc - parent version 7 is released. Learn to use parent version 7 in Maven based Java projects
( com.groupbyinc - parent version 7 ) in their Java project if it is based on Maven... to use  com.groupbyinc - parent version 7 in Java projects. Follow the step... that downloads and includes  com.groupbyinc - parent version 7 java library
Maven dependency for com.cedarsoft - open version 7 is released. Learn to use open version 7 in Maven based Java projects
- open version 7 ) in their Java project if it is based on Maven and Gradle. How...; com.cedarsoft - open version 7 in Java projects. Follow the step by step tutorial...; com.cedarsoft - open version 7 java library in your project. Now you can save
Control Flow Statements in java 7
Control Flow Statements in java 7 In this section we will discuss Control Flow Statements in java 7. This is one type of Language Fundamentals. Control Flow Statements : - In general program execution flow is from top to bottom
JAVA code For
JAVA code For   JAVA code For "Traffic signals Identification for vehicles
JAVA CODE
JAVA CODE  JAVA SOURCE CODE TO BLOCK A PARTICULAR WEB SITES(SOCIAL WEB SITE
java code
java code  write a java code to convert hindi to english using arrays
Decision-making Statements in java 7
Decision-making Statements in java 7 In this section, we will discuss about Decision-making Statements in java 7. This is one type of control flow statement. Decision-making Statements : This kind of control statements is used where
java code
java code  need java code for chart or graph which compare the performance of aprior algorithm and coherent rule algorithm.plz any one help me out
java code
java code  write a java code for finding a string in partiular position in a delimited text file and replace the word with the values given by user and write the file in new location
java code
java code  sir how to merge the cells in excel using java code please help me and also how to make the text placed in the cell to be center

Ads