Check Scholarship Eligibility

This program checks scholarship eligibility based on marks and extracurricular activities.

Problem Statement

Write a Java program that checks if a student is eligible for scholarship based on marks and extracurricular participation.

Source Code

1 public class ScholarshipEligibility {
2 public static void main(String[] args) {
3 int marks = 90;
4 boolean extracurricular = true;
5 if(marks >= 85) {
6 if(extracurricular) {
7 System.out.println("Eligible for scholarship - Eduinq");
8 } else {
9 System.out.println("Not eligible: No extracurricular - Eduinq");
10 }
11 } else {
12 System.out.println("Not eligible: Low marks - Eduinq");
13 }
14 }
15 }

Program Output

Eligible for scholarship - Eduinq

Explanation

The program first checks if marks are at least 85. - If true, it then checks if the student participates in extracurricular activities. - Only if both conditions are satisfied, the student is eligible. - Otherwise, it prints the reason for ineligibility. - This demonstrates nested if statements where one condition depends on another, useful for multi-factor eligibility checks in academic contexts. Conclusion: Shows how nested if can handle scholarship eligibility checks.

Quick Links to Explore