SOLUTION CODE FOR ABOVE QUESTION
/*
This program is written to divide the students into four counselling slots
*/
package com.company;
import java.util.*;
public class Main {
public static void main(String[] args) {
// write your code here
Scanner sc = new Scanner(System.in);
System.out.println("\nHello welcome to our program, enter the students details," +
"\nto know the slot which the student belongs to");
System.out.print("\nEnter the students cut off marks: ");
int cut_of_marks = sc.nextInt();
System.out.print("Enter the students age: ");
int age = sc.nextInt();
System.out.print("Enter the HSC mark: ");
int hsc = sc.nextInt();
System.out.print("Enter the students Secondary Level School Certificate(SSLC) Mark: ");
int sslc = sc.nextInt();
if(age > 18 & cut_of_marks > 79 & hsc > 79 & sslc > 79)
{
System.out.println("\nThe student belongs to 1st Slot of Counseling");
}
else if(age > 18 & cut_of_marks > 69 & hsc > 69 & sslc > 69)
{
System.out.println("\nThe student belongs to 2st Slot of Counseling");
}
else if(age > 18 & cut_of_marks > 50& hsc > 50 & sslc > 50)
{
System.out.println("\nThe student belongs to 3rd Slot Counseling");
}
else
{
System.out.println("\nThe student belongs to 4rd Slot Counseling");
}
}
}
SAMPLE PROGRAM OUTPUT
Comments
Leave a comment