Math problem generator in Java