M
M
Makaron30002021-05-13 13:49:33
Java
Makaron3000, 2021-05-13 13:49:33

Why expected 66 and get 65?

A method that outputs yearly estimates. But when testing, for some reason an error occurs, for example, Expected 66 but was 65? Help me please.

public class GrassHopper {

    public static char getGrade(int s1, int s2, int s3) {
      int score = (s1 + s3 + s3) / 3;
      if(score >= 90 && score <= 100)return 'A';
      else if(score >= 80) return 'B';
      else if(score >= 70) return 'C';
      else if(score >= 60) return 'D';
        return 'F';
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
twobomb, 2021-05-13
@twobomb

But don't be confused by int score = (s1 + s3 + s3 ) / 3; ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question