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 gradeA
- If
percentage >= 80
, then assign gradeB
- If
percentage >= 70
, then assign gradeC
- If
percentage >= 60
, then assign gradeD
- If
percentage >= 50
, then assign gradeE
- If
percentage < 50
andpercentage >= 0
, then assign gradeF
- If
percentage > 100
orpercentage < 0
, then assignabsurd
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 1400+ tech skills courses.