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



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


arvind
java code 7
1 Answer(s)      4 years ago
Posted in : JavaScript Questions


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.


Advertisement
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
Data Types in Java 7
In this section we will discuss Java 7 Data Types
Advertisements
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
Java 7 Language Fundamentals
This tutorial describes basic language features of Java 7
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
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
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
Installing Java (JDK 7) on Windows 7 Computer Video Tutorial
Installing Java (JDK 7) on Windows 7 Computer Video Tutorial
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
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
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... to repeat block of code under particular condition. It is single line
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
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
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
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
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 EE 7 Platform Receives Final Approval from JCP Executives
Java, Java EE 7 has got the approval of Java Community Process executive... that the Java EE 7 Platform and Web Profile JSR have received the final approval... EE 7 umbrella.," she wrote. The new Java EE 7 Platform consists of 14 Java
JAVA code For
JAVA code For   JAVA code For "Traffic signals Identification for vehicles
java code
java code  write a java code to convert hindi to english using arrays
JAVA CODE
JAVA CODE  JAVA SOURCE CODE TO BLOCK A PARTICULAR WEB SITES(SOCIAL WEB SITE
java code
java code  what is the code to turn off my pc through java program
Installing JDK 7 on Windows
windows 7 computer. Check more tutorial for Java beginner in our Java...Installing JDK 7 on Windows - Beginners tutorial for installing configuring the JDK 7 development environment on your computer This tutorial is your first
Advertisements
 

 

 

DMCA.com