我是JAVA入门级别的菜鸟,现在跟着stanford的公开课学习JAVA语言,用的是eclipse3.2stanford版本,应该和正常版本差不多的..前几天运行了kareltherobotlearningJAVA的软件,所以现在写...
我是JAVA入门级别的菜鸟, 现在跟着stanford 的公开课学习JAVA语言, 用的是eclipse 3.2 stanford 版本, 应该和正常版本差不多的.. 前几天运行了 karel the robot learning JAVA的软件, 所以现在写下来的代码一点运行就没有可以选择的方式去运行。
我的代码大概是这种类型的
/* File: 3.1.java
*-----------------------------
*This program converts feet and inches to centimeters.
*/
import acm.program.*;
public class feetAndInchesToCentimeters extends ConsoleProgram {
public void run (){
printIn (" This program converts feet and inches to centimeters.");
double feet = readDouble ("Enter value in feet: ");
double inches = readDouble ("Enter value in inches: ");
Double centimeter = (feet/ CENTIMETERS_PER_FOOT)+(inches/CENTIMETERS_PER_INCHES);
printIn(feet+"ft" + inches + "in=" + centimeter+"cm");
}
private static final double CENTIMETERS_PER_FOOT = 2.54*12;
private static final double CENTIMETERS_PER_INCHES= 2.54;
}
只是一个纯粹的编程练习, 不知道要怎么操作才能在eclipse上看到效果呢?能不能详细讲一下从打开eclipse到运行需要点哪些东西。 是不是要下载 acm. program 的package呢 (如果程序本身没有)?
谢谢各位高手~~
大家说的东西我都看不懂唉
说直接点, 我就是刚刚装了一个eclipse,找不到合适的run method去运行简单的program 比如 hello world, 计算器什么的, 有人能够手把手的教我怎么操作么
展开