/** * Program to calculate the mean of three numbers * @author Andy Evans * The next two lines are important for the code to run - we'll look at these * in the practical **/ class Calculate { public static void main (String args[]) { // Get 3 numbers. // "ints" are integer numbers. int numberOne = 7; int numberTwo = 23; int numberThree = 42; // Sum the numbers. int sum = numberOne + numberTwo + numberThree; // Divide the sum by 3. // "doubles" are numbers with decimal places. double result = sum/3; // Print the result. System.out.println(result); } }