简体   繁体   English

我如何将我的方法中的 output 信息作为一个表发送给用户?

[英]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:我试过了:

  • sDeviation(celsius); s偏差(摄氏度);
  • double fDeviation = sDeviation(celsius);双 fDeviation = sDeviation(摄氏度);

GitHub GitHub

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.

相关问题 如何将信息从Override的ActionListener方法发送到Java中的main方法? - How do I send information from my Overridden ActionListener method to the main method in Java? 如何将包含 5 个并行数组的输出表从主类打印到 .txt 文件? - How do I print my output table with 5 parallel arrays from my main class to a .txt file? 在Windows命令行上,如何将cat的输出输入到java main方法中? - On the Windows command line, how do I feed output from cat into my java main method? 如何从 JPA 中的 ManyToMany 表中选择信息? - How do I select information from ManyToMany Table in JPA? 如何修复我的方法以输出一个答案? - how do I fix my method to output one answer? 如何使方法的主体正确输出? - How do I get the body of my method to output properly? 如何使用toString检索我的班级中的信息,以及如何获取用于计算此类中的“ GPA”的方法? - How do I use toString to retrieve my information in my class and how do I get my method to calculate the “GPA” in this class? 如何从PubNub方法history()在ListView中输出消息? - How do I output messages in ListView from PubNub method history()? 如何防止反向方法影响平方输出? - How do I keep the Reversed method from affecting the Squared output? 如何用数据库中的信息填充HashMap,然后将其添加到Jasper报告中? - How do I fill my HashMap with information from my database, and then add it to my Jasper Report?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM