Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | IT Developer <?php echo $page_title; ?>
IT Developer

Conditional Constructs in Java

Chapter 8

Conditional Constructs in Java

Class 10 - Logix Kips ICSE Computer Applications with BlueJ


Share with a Friend

Java Program: Admission Eligibility Check


23. Admission in a professional course is subject to the following criteria:

Marks in Physics >= 70
Marks in Chemistry >= 60
Marks in Mathematics >= 70
Total marks in all subjects >= 225
Or
Total marks in Physics and Mathematics >= 150

Write a program in Java to accept marks in these 3 subjects (Physics, Chemistry, and Mathematics) and display if a candidate is eligible.

import java.util.Scanner;

 

public class AdmissionEligibility {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

 

        System.out.print("Enter Physics marks: ");

        int physics = sc.nextInt();

 

        System.out.print("Enter Chemistry marks: ");

        int chemistry = sc.nextInt();

 

        System.out.print("Enter Mathematics marks: ");

        int maths = sc.nextInt();

 

        int total = physics + chemistry + maths;

        int phyMathTotal = physics + maths;

 

        if ((physics >= 70 && chemistry >= 60 && maths >= 70 && total >= 225)

                || phyMathTotal >= 150) {

            System.out.println("Candidate is eligible for admission.");

        } else {

            System.out.println("Candidate is not eligible for admission.");

        }

 

        sc.close();

    }

}

Output

Sample Input 
Enter Physics marks: 75
Enter Chemistry marks: 65
Enter Mathematics marks: 80

Sample Output 
Candidate is eligible for admission.

Eligibility Logic Used

A candidate is eligible if either of the following is true:

Physics ≥ 70
Chemistry ≥ 60
Mathematics ≥ 70
Total ≥ 225

OR

Physics + Mathematics ≥ 150