Java grade calculator