Hey there, I am extremely new to java and was wanting some help on this bug I am getting.
My code is as follows:
But whenever I run the program, no matter what I do, I get my average is 0.0Code:import java.util.Scanner;
public class bavg{
public static void main (String args[]){
Scanner keyboard=new Scanner(System.in);
System.out.println("Enter the amount of at-bats.");
int ab=keyboard.nextInt();
System.out.println("Now, enter the amount of hits.");
int hits=keyboard.nextInt();
double avg=(hits/ab);
System.out.println("Your batting average is "+avg+".");
}
}
Anyone have any suggestions?
Again I am very new to java so I apologize in advance for any silly mistakes.

