Answer to Question #239338 in Java | JSP | JSF for japjeet kaur

Question #239338

The Admission to a professional course is done using the following conditions.


a) Marks in Maths> =60


b) Marks in Physics >=50


c) Marks in chemistry >=40


d) Total in all the three subjects >=200 (or) Total in Maths and Physics >=150


Given the marks of three subjects, write a java program to process the applications to list the eligible candidates.  (with if and if else only)



1
Expert's answer
2021-09-19T17:11:31-0400
import java.util.Scanner;


public class Candidate {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int math,physics,chemistry;
        System.out.print("Enter the marks obtained in Mathematics: ");  
        math=sc.nextInt();
        System.out.print("Enter the marks obtained in Physics: ");  
        physics=sc.nextInt();
        System.out.print("Enter the marks obtained in Chemistry: ");  
        chemistry=sc.nextInt();
        if(math >= 60 && physics >= 50 && chemistry >= 40 && 
        ((math + physics + chemistry) >= 200 || (math + physics) >= 150)){
            System.out.println("\nThe candidate is eligible for admission.");  
        }else{
            System.out.println("\nThe candidate is NOT eligible for admission.");  
        }
        
        sc.close();
        
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS