fork download
  1. class Main {
  2. public static void main(String[] args) {
  3. System.out.print("letter ");
  4. getletter(20.5);
  5. System.out.print("\nletter is ");
  6. getletter(90.5);
  7. }
  8. public static void getletter(double n){
  9. if (n < 20.0) System.out.println("J") ;
  10. else if (n < 70.0) System.out.println("K") ;
  11. else System.out.println("L") ;
  12. }
  13. }
Success #stdin #stdout 0.08s 54672KB
stdin
Standard input is empty
stdout
letter K

letter is L