我需要知道如何对用户输入的数字列表进行计算。到目前为止,这是我的代码,我不知道如何继续。我需要编写一个代码来询问用户是否要手动输入数字或从文件上传。如果用户选择手动,我必须找到平均值、最小值、最大值和支架。开发。他们输入的数字。任何帮助,将不胜感激
import java.io.*;
public class computation {
//main method starts
public static void main (String[] args) throws Exception {
//create text input reader
InputStreamReader get = new InputStreamReader(System.in);
BufferedReader got = new BufferedReader(get);
//create a text printer
PrintWriter send = new PrintWriter(System.out,true);
//defining a string type variable for user input
String answer1;
//asks the user if they want to input data from keyboard
String question = "Do you want to input data manually? Enter y or n";
send.println(question);
//system reads user input
answer1 = got.readLine();
if (answer1.equals("y")) {
send.println("Enter numbers separated by spaces");
String datacurrent = got.readLine();
} //end of "y" if
if (answer1.equals("n")) {
send.println("Enter the path of your data file");
} //end of "n" if
} //end of main method
} //end of class computation