[英]How do I output information from my Method to the user as a table?
For my program, I'm trying to use data from a file that will take the numbers(which stand for Celsius) and use them to calculate standard deviation/convert to Fahrenheit.对于我的程序,我正在尝试使用来自文件的数据,该文件将采用数字(代表摄氏度)并使用它们来计算标准偏差/转换为华氏度。 I've already created the methods for the calculation but I'm not sure what is the right way of outputting the information from those methods to the user when I run the code.我已经创建了计算方法,但我不确定在运行代码时从这些方法向用户输出信息的正确方法是什么。
I've tried:我试过了:
I can only guess at your intent Looking at this method:我只能猜测你的意图看看这个方法:
private static void printTable(int[] year, double[] celsius) {
System.out.println("Year\tCelsius\tsDeviation");
//for loop
for(int i = 0; i < year.length; i++) {
System.out.println(year[i] + "\t" + celsius[i] + "\t" + sDeviation(celsius[i]));
}
}//end printTable
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.