我如何将numberGrade的值设置为如此,如果它是89.5则变为90. numberGrade被视为double,但使其成为int不会向上或向下舍入.
public class GradeReporter
{
// The limit is the inclusive lower limit for each letter
// grade -- this means that 89.5 is an 'A' not a 'B'
public static final double A_LIMIT = 90;
public static final double B_LIMIT = 80;
public static final double C_LIMIT = 70;
public static final double D_LIMIT = 60;
public static final double F_LIMIT = 60;
/** Converts a numeric grade into a letter grade. Grades should be rounded to
* …Run Code Online (Sandbox Code Playgroud)