我正在尝试使用方法来显示一个值,然后以不同的十进制格式交替显示它。主要问题是输入后我无法调用该值。这是我知道的唯一问题,但如果还有其他我没有掌握的东西,我会非常感谢任何洞察力。
//*************************************************
//Hwk8 This Program displays Java Methods
//Written By: Daniel Kellogg
//Last Modified: 11/05/12
//************************************************
import java.util.Scanner;
import java.io.*;
import java.text.DecimalFormat;
import javax.swing.JOptionPne;
public class Hwk8 {
public static void main (String[] args) throws IOException {
double value;
double value2;
double value3;
double value4;
double value5;
value = getValue();
System.out.println(value);
value2 = getValue2();
System.out.println(value2);
value3 = getValue3();
System.out.println(value3);
value4 = getValue4();
System.out.println(value4);
value5 = getValue5();
System.out.println(value5);
System.exit(0);
}
public static double value()
{
double value;
value = JOptionPane.showInputDialog("enter value");
return value;
}
public static double value2(value) throws IOException
{
double value2;
value2 = roundToInteger(value);
return value2;
}
public static double value3(value) throws IOException
{
double value3;
value3 = roundToTenths(value);
return value3;
}
public static double value4(value) throws IOException
{
double value4;
value4 = roundToHundredths(value);
return value4;
}
public static double value5(value) throws IOException
{
double value5;
value5 = roundToThousandths(value);
return value5;
}
}