Simple test ----Compute the area of a circle
来源:互联网 发布:linux 设置启动内核 编辑:程序博客网 时间:2024/06/05 01:53
import java.util.Scanner; //Scanner is in the java.util package
import javax.swing.JOptionPane;
public class Java_test {
public static void main(String args[]) {
double radius;
double area;
Scanner input=new Scanner(System.in); //Create a Scanner object
radius=input.nextDouble(); //Input a radius
System.out.println("The area of a circle with radius "+radius+" is "+area);
//Display in a message dialog box
JOptionPane.showMessageDialog(null,"The area of a circle with radius "
+radius+" is "+area, "Compute area of circle",
JOptionPane.INFORMATION_MESSAGE);
}
}
import javax.swing.JOptionPane;
public class Java_test {
public static void main(String args[]) {
double radius;
double area;
Scanner input=new Scanner(System.in); //Create a Scanner object
//Prompt the user to enter a radius
radius=input.nextDouble(); //Input a radius
input.close();
System.out.println("The area of a circle with radius "+radius+" is "+area);
//Display in a message dialog box
JOptionPane.showMessageDialog(null,"The area of a circle with radius "
+radius+" is "+area, "Compute area of circle",
JOptionPane.INFORMATION_MESSAGE);
}
}
0 0
- Simple test ----Compute the area of a circle
- Compute the height of a binary tree
- Compute the region of specific value inside a dataset
- compute the max sum of a continuours subset
- compute the max sum of a continuours subset
- Compute the height of a binary search tree
- POJ1389-Area of Simple Polygons
- POJ1389[Area of Simple Polygons]
- poj1389 Area of Simple Polygons
- A Simple Interpretation of the 4GWM
- The Circumference of the Circle
- A Simple PE Test
- A Simple WCF Test
- Algorithm to find the area of a polygon
- Area of a Parallelogram
- HDU 3964 Find The Simple Circle
- pku2242The Circumference of the Circle
- the composition of the coluding compute
- 在WindowFrom中画一条直线
- OGRE(八):Ogre例子中的Character脱离Browser的代码
- mahout过滤推荐结果 Recommender.recommend(long userID, int howMany, IDRescorer rescorer)
- 为业务流程构筑引擎BEA WebLogic Process IntegratorTM
- mac OS X 10.9.2 gdb codesign
- Simple test ----Compute the area of a circle
- 模版--截取字符
- 使用之Web Services开发工具--Borland推出专供Java
- 理解一般指针和指向指针的指针
- iOS7开发中的新特性,开发者需要注意了
- 2014阿里实习面试经验
- VPS使用xampp Apache出现的CPU高占用率的问题
- HashMap深度分析与比较 "Java Collections
- Android ListView使用BaseAdapter与ListView的优化