if (condition1) {
// الكود اللي هيتنفذ لو الشرط الأول صحيح
} else if (condition2) {
// الكود اللي هيتنفذ لو الشرط الثاني صحيح
} else {
// الكود اللي هيتنفذ لو كل الشروط السابقة خاطئة
}
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter your score: ");
int score = scanner.nextInt();
if (score < 0 || score > 100) {
System.out.println("Invalid score. Please enter a score between 0 and 100.");
} else if (score >= 90) {
System.out.println("Excellent! You got an A.");
} else if (score >= 80) {
System.out.println("Very Good! You got a B.");
} else if (score >= 70) {
System.out.println("Good! You got a C.");
} else if (score >= 60) {
System.out.println("Passed! You got a D.");
} else {
System.out.println("Unfortunately, you failed. You got an F.");
}
// رسالة شكر للمستخدم
System.out.println("Thank you for using the grading system.");
}
}