import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
*
* @author paiman
*/
public class AverageValue {
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
double[] nilai = new double[4];
System.out.print("Value A : ");
nilai[0] = Double.parseDouble(in.readLine());
System.out.print("Value B : ");
nilai[1] = Double.parseDouble(in.readLine());
System.out.print("Value C : ");
nilai[2] = Double.parseDouble(in.readLine());
nilai[3] = (nilai[0] + nilai[1] + nilai[2])/3;
System.out.println("\nAverage value = " + nilai[3]);
}
}
0 comments:
Post a Comment