Else-if ladder
📖 Scenario: You are creating a simple program that assigns a grade based on a student's score.
🎯 Goal: Build a Java program that uses an else-if ladder to print the correct grade for a given score.
📋 What You'll Learn
Create an integer variable called
score with the exact value 85.Create an integer variable called
passingScore with the exact value 50.Use an
else-if ladder with the variable score to assign grades:90 and above is Grade A80 to 89 is Grade B70 to 79 is Grade C60 to 69 is Grade D50 to 59 is Grade EBelow
50 is Fail.Print the grade using
System.out.println.💡 Why This Matters
🌍 Real World
Grading systems in schools or colleges use similar logic to assign letter grades based on numeric scores.
💼 Career
Understanding conditional statements like else-if ladders is essential for decision-making in software development.
Progress0 / 4 steps