Challenge: Grades and Temperature

Complete the grade calculator and temperature checker challenge.

We'll cover the following

Grade calculator

Write a program to print the grades of students using if and else in Java. Implement the following conditions:

  • If percentage >= 90, then assign grade A
  • If percentage >= 80, then assign grade B
  • If percentage >= 70, then assign grade C
  • If percentage >= 60, then assign grade D
  • If percentage >= 50, then assign grade E
  • If percentage < 50 and percentage >= 0, then assign grade F
  • If percentage > 100 or percentage < 0, then assign absurd

Cater to the boundary cases as well. Use the exact output with extra care to case sensitivity.

Note: Don’t worry if you need help. You can see the solution by pressing the “Show Solution” button.

Get hands-on with 1200+ tech skills courses.