public class BattingAverage
{
    public int hits;
    public int atBats;

    public BattingAverage()
    {
    }
    
    public BattingAverage(int h, int ab)
    {
	hits = h;
	atBats = ab;
    }
    
    public double getBattingAverage()
    {
	if (atBats != 0)
	    return (double) hits / (double) atBats;
	else
	    return 0;
    }
}
