import java.util.Scanner;

 public class Solution
 {
     public static void main(String[] args)
     {
         Scanner input = new Scanner(System.in);

         System.out.print("Enter the radius and length of a cylinder: ");

         double radius = input.nextDouble();
         double length = input.nextDouble();

         double area = radius * radius * Math.PI;
         double volume = radius * radius * Math.PI * length;

         System.out.println("The area is " + area);
         System.out.println("The volume is " + volume);

         input.close();
     }
 }

HW2.2的更多相关文章

  1. JAVA HW2

    MODEL //yuec2 Yue Cheng package hw2; import java.io.File; import java.io.FileNotFoundException; impo ...

  2. Software Testing hw2

    Fault的定义:可能导致系统或功能失效的异常条件(Abnormal condition that can cause an element or an item tofail.),可译为“故障”. ...

  3. HW2.25

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  4. HW2.24

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  5. HW2.23

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  6. HW2.22

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  7. HW2.21

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  8. HW2.20

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  9. HW2.19

    public class Solution { public static void main(String[] args) { char outcome; long randomNumber; wh ...

  10. HW2.18

    public class Solution { public static void main(String[] args) { System.out.println("a" + ...

随机推荐

  1. jquery方法的参数解读

    18:22 2013/9/21 attr(name|properties|key,value|fn) 概述 设置或返回被选元素的属性值. 在jquery中[]表示可选参数,你可以不选,| 表示参数可以 ...

  2. Javascript 5种方法实现过滤删除前后所有空格

    第一种:循环检查替换 //供使用者调用 function trim(s){ return trimRight(trimLeft(s)); } //去掉左边的空白 function trimLeft(s ...

  3. http://www.tuicool.com/articles/RzUzqei

    http://www.tuicool.com/articles/RzUzqei http://www.cnblogs.com/piaolingzxh/archive/2015/01/01/419783 ...

  4. [string]Codeforces158C Cd and pwd commands

    题目链接 题意很清楚 和linux的语句是一样的 pwd输出路径 cd进入 ..回上一层目录 此题完全是string的应用 String的用法 vector<string> s; int ...

  5. UVA 515 King

    差分约束系统的第一个题目,看了落花大神的博客后,对差分约束有了一定了解,关键在于建图,然后就是判断是否存在负权回路. 关于差分约束系统的解释详见维基百科:http://zh.wikipedia.org ...

  6. 10行Python代码解决约瑟夫环(模拟)

    http://blog.csdn.net/dengyaolongacmblog/article/details/39208675 #!/usr/bin/env python # coding: utf ...

  7. TYPE C PD测试板 UFP测试板

  8. ALT+数字,可输入汉字或拉丁字母 good

    各种编码查询表:http://bm.kdd.cc/ 输入 ALT + 50385 就出 难 字了,原因是它的十六进制ANSI编码是C4D1=50385 同理: 汉=BABA=47802字=D7D6=5 ...

  9. 【HDOJ】Power Stations

    DLX.针对每个城市,每个城市可充电的区间构成一个plan.每个决策由N*D个时间及N个精确覆盖构成. /* 3663 */ #include <iostream> #include &l ...

  10. mingw32 下编译 zlib

    cp win32/makefile.gcc makefile.gcc make -f makefile.gcc make install -f Makefile.gcc INCLUDE_PATH=/m ...