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









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
Arrays in java 7
This tutorial describes the concept of Arrays in java 7
Operators in java 7
This tutorial describes the concept of operators 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.ADS_TO_REPLACE_1 Java version 7: Java Version SE 7was launched... and Automatic null Handling. Difference between Java 6 and Java 7: In terms
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.ADS_TO_REPLACE_1 In java 7, Continue statement stops the current
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... for day value 2,3..up to 7 to assign days value Monday, Tuesday...up to Saturday. We
If statement in java 7
If statement in java 7 This tutorial describes the if statement in java 7...{ ........ ......//statements } Nested Ifs  statements : In java, you can use nested... 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... : If you want to terminate the outer statement java provides the way to do
java bits 7 - Java Interview Questions
java bits 7  Given: 20. public class CreditCard { 21. 22. private String cardlD; 23. private Integer limit; 24. public String ownerName; 25... encapsulated. B. The code demonstrates polymorphism. C. The ownerName variable breaks
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
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... : For loop provides a way to repeat block of code under particular condition
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 is another branching statement provided by the java 7. Its
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... loop example... Hello 1 Hello 2 Hello 3 Hello 4 Hello 5 Hello 6 Hello 7
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
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
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... and install JDK 7 on your computer. To make your computer ready for Java
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 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
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
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... and includes  com.cedarsoft - open version 7 java library in your project
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...;version>7</version> </dependency> Above code is the maven
Text box size varying in IE 7 but ok in firefox - Java Beginners
Text box size varying in IE 7 but ok in firefox  I have problem with the size of text field which varies in IE 7 only but its fixed in Firefox( I... longer only in IE).Expecting a fast solution,Im sharing the piece of code
JAVA code For
JAVA code For   JAVA code For "Traffic signals Identification for vehicles
java code
java code  what is the code to turn off my pc through java program
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
java code
java code  hi any one please tell me the java code to access any link i mean which method of which class is used to open any link in java program
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
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
java code
java code  I need the java code that would output the following: HARDWARE ITEMS CODE DESCRIPTION UNIT PRICE K16 Wood screws,brass,20mm $7.75 D24 Wood glue,clear,1 liter $5.50 M93
Java code
Java code   Create a washing machine class with methods as switchOn, acceptClothes, acceptDetergent, switchOff. acceptClothes accepts the noofClothes as argument & returns the noofClothes
Maven dependency for com.aspectran - aspectran-parent version 7 is released. Learn to use aspectran-parent version 7 in Maven based Java projects
use this version ( com.aspectran - aspectran-parent version 7 ) in their Java...-parent version 7 in Java projects. Follow the step by step tutorial for using...;version>7</version> </dependency> Above code is the maven
Maven dependency for com.adeptj - adeptj-parent version 7 is released. Learn to use adeptj-parent version 7 in Maven based Java projects
( com.adeptj - adeptj-parent version 7 ) in their Java project if it is based... in project? Steps to use  com.adeptj - adeptj-parent version 7 in Java projects...;/artifactId> <version>7</version> </dependency> Above code
Maven dependency for com.blazebit - blazebit-parent version 7 is released. Learn to use blazebit-parent version 7 in Maven based Java projects
this version ( com.blazebit - blazebit-parent version 7 ) in their Java project... version 7 in Java projects. Follow the step by step tutorial for using the latest... that downloads and includes  com.blazebit - blazebit-parent version 7 java library
Maven dependency for org.openjfx - javafx version 15-ea+7 is released. Learn to use javafx version 15-ea+7 in Maven based Java projects
( org.openjfx - javafx version 15-ea+7 ) in their Java project if it is based...? Steps to use  org.openjfx - javafx version 15-ea+7 in Java projects...; <version>15-ea+7</version> </dependency> Above code
Maven dependency for com.cathive - oss-parent version 7 is released. Learn to use oss-parent version 7 in Maven based Java projects
( com.cathive - oss-parent version 7 ) in their Java project if it is based on Maven...? Steps to use  com.cathive - oss-parent version 7 in Java projects. Follow...; <version>7</version> </dependency> Above code is the maven
Maven dependency for org.openjfx - javafx version 16-ea+7 is released. Learn to use javafx version 16-ea+7 in Maven based Java projects
( org.openjfx - javafx version 16-ea+7 ) in their Java project if it is based...? Steps to use  org.openjfx - javafx version 16-ea+7 in Java projects...; <version>16-ea+7</version> </dependency> Above code
java code
java code  develop a banking system in java
java code
java code  HOW TO PRINT 1 TO 100 WITHOUT USING CONDITIONAL,ANY LOOP AND ARRAY IN JAVA AND C.URGENT SIR PLZ  Hi, You can use following code: class MyClass { public static void main(String[] args) { int
java code
java code  how to extract html tags using java
Java code
Java code  Write a program which performs to raise a number to a power and returns the value. Provide a behavior to the program so as to accept any... the following code: import java.util.*; import java.text.*; class NumberProgram
java code
java code  int g() { System.out.println("Inside method g"); int h() { System.out.println("Inside method h"); } } Find the error in the following... cannot define a method inside another method. Anyways, we have modified your code
java code
java code  what is meaning bufferedreader

Ads