Im trying to make it so that java outputs something like 2.66 when the user inputs 1,2, and 5. However, it just prints 2.00. How can I fix this?
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Please input first integer: ");
int a = in.nextInt();
System.out.print("Please input second integer: ");
int b = in.nextInt();
System.out.print("Please input third integer: ");
int c = in.nextInt();
float calculateInput = (float)((a+b+c)/3);
System.out.printf("The average of %s, %s, and %s is %.2f \n", a, b, c, calculateInput);
double e = (double)(1+2+5)/3;
System.out.print(calculateInput);
}