Skip to content
Related Articles

Related Articles

Improve Article

Java Program to Check the Eligibility of TPP Students for Appearing in Interviews

  • Difficulty Level : Easy
  • Last Updated : 11 Feb, 2021

Problem Statement: This is a Java program for placements and interview criteria such as how many students will appear for online tests, academic results, and Amcat scores, etc. As per the criteria set in the code, it is easy to check who is eligible for appearing in the MNCs like Google, Amazon, and Microsoft, etc.

Concept: The naive approach is directly applied which does include the concepts of arrays and strings come into play during the implementation in order to achieve the goal.

Procedure:

  1. Make a java class say be it relevantly named as ‘interview’.
  2. Enter UID, name, GPA, Amcat score.
  3. Set the eligibility criteria as shown below in order to demonstrate the implementation.
    • If GPA is above 7, and the Amcat score is above 600
      • Then the student is eligible for a Google interview.
    • If GPA is above 7.5, and Amcat score is above 750
      • Then the student is eligible for a Microsoft interview.
    • If GPA is above 8, and Amcat score is above 700
      • Then the student is eligible for an Amazon interview.

Pictorial representation of the criteria is as follows:



Illustration:

INPUT:

Enter number of Students who have taken TPP: 2

Enter UID of Student 1: 11

Enter Name of Student 1: Pavan

Enter CGPA of Student 1: 8.8

Enter AMCAT Score of Student 1: 805

Enter UID of Student 2: 22

Enter Name of Student 2: Aman

Enter CGPA of Student 2: 7.5

Enter AMCAT Score of Student 2: 750

OUTPUT:

For Google Students having CGPA above 7.00 and AMCAT score above 600 are eligible for further tests

Shortlisted Students are:

UID           Name         CGPA         AMCAT

11          Pavan           8.800000       805  

22          Aman            7.500000      750  

For Microsoft Students having CGPA above 7.50 and AMCAT score above 750 are eligible for further tests



Shortlisted Students are:

UID        Name             CGPA       AMCAT

11          Pavan           8.800000       805  

22          Aman            7.500000      750  

For Amazon Students having CGPA above 8.00 and AMCAT score above 700 are eligible for further tests

Shortlisted Students are:

UID         Name           CGPA        AMCAT

11          Pavan           8.800000      805      

INPUT:

Enter Coding test Scores for Google:



Enter Coding Test score of UID 11: 500

Enter Coding Test score of UID 22: 600

Enter Coding test Scores for Microsoft:

Enter Coding Test score of UID 11: 500

Enter Coding Test score of UID 22: 600

Enter Coding test Scores for Amazon:

Enter Coding Test score of UID 11: 500

OUTPUT:

Students eligible to sit for Google interview

UID        Name             CGPA          AMCAT

11          Pavan           8.800000       805  

22          Aman            7.500000      750  

Students eligible to sit for Microsoft interview

UID         Name            CGPA        AMCAT

11          Pavan           8.800000       805  

22          Aman            7.500000      750  

Students eligible to sit for Amazon interview

UID         Name            CGPA          AMCAT

11          Pavan           8.800000        805  

Process finished with exit code 0

Example

Java




// Importing Scanner class to
// take input from th user
import java.util.Scanner;
  
// Class
public class interview {
  
    // Main driver method
    public static void main(String[] args)
    {
  
        // Creating an object of Scanner class
        // to read input fom keyboard
        Scanner sc = new Scanner(System.in);
  
        // Display message for beter readibility
        System.out.print(
            "Enter number of Students who have taken TPP: ");
  
        // Reading and storing primitive value
        // Integer type using nextInt() method
        int n = sc.nextInt();
  
        // Creating arrays
        String[] ar = new String[n];
        String[] arr = new String[n];
        double[] arr1 = new double[n];
  
        int[] arr2 = new int[n];
  
        double[] s1 = new double[n];
        double[] s2 = new double[n];
        double[] s3 = new double[n];
  
        // Interating over th input values
        // as received from user
        for (int i = 0; i < n; i++) {
            sc.nextLine();
            System.out.print("Enter UID of Student "
                             + (i + 1) + ": ");
            ar[i] = sc.nextLine();
            System.out.print("Enter Name of Student "
                             + (i + 1) + ": ");
            arr[i] = sc.nextLine();
            System.out.print("Enter CGPA of Student "
                             + (i + 1) + ": ");
            arr1[i] = sc.nextDouble();
            System.out.print("Enter AMCAT Score of Student "
                             + (i + 1) + ": ");
            arr2[i] = sc.nextInt();
            System.out.print("\n");
        }
  
        System.out.println(
            "\nFor Google Students having CGPA above 7.00 and AMCAT score above 600 are eligible for further tests");
        System.out.println("\nShortlisted Students are:");
        System.out.print(
            "UID\t\t\tName\t\t\tCGPA\t\tAMCAT\n");
        for (int i = 0; i < n; i++) {
            if (arr1[i] >= 7.00) {
                if (arr2[i] >= 600) {
                    System.out.printf(
                        "%-12s%-16s%-12f%-6d\n", ar[i],
                        arr[i], arr1[i], arr2[i]);
                }
            }
        }
  
        System.out.println(
            "\nFor Microsoft Students having CGPA above 7.50 and AMCAT score above 750 are eligible for further tests");
        System.out.println("\nShortlisted Students are:");
        System.out.print(
            "UID\t\t\tName\t\t\tCGPA\t\tAMCAT\n");
        for (int i = 0; i < n; i++) {
            if (arr1[i] >= 7.50) {
                if (arr2[i] >= 750) {
                    System.out.printf(
                        "%-12s%-16s%-12f%-6d\n", ar[i],
                        arr[i], arr1[i], arr2[i]);
                }
            }
        }
  
        System.out.println(
            "\nFor Amazon Students having CGPA above 8.00 and AMCAT score above 700 are eligible for further tests");
        System.out.println("\nShortlisted Students are:");
        System.out.print(
            "UID\t\t\tName\t\t\tCGPA\t\tAMCAT\n");
        for (int i = 0; i < n; i++) {
            if (arr1[i] >= 8.00) {
                if (arr2[i] >= 700) {
                    System.out.printf(
                        "%-12s%-16s%-12f%-6d\n", ar[i],
                        arr[i], arr1[i], arr2[i]);
                }
            }
        }
  
        System.out.print(
            "\nEnter Coding test Scores for Google:");
        for (int i = 0; i < n; i++) {
            if (arr1[i] >= 7.00) {
                if (arr2[i] >= 600) {
                    System.out.print(
                        "\nEnter Coding Test score of UID "
                        + ar[i] + ": ");
                    s1[i] = sc.nextDouble();
                }
            }
        }
  
        System.out.print(
            "\nEnter Coding test Scores for Microsoft:");
        for (int i = 0; i < n; i++) {
            if (arr1[i] >= 7.50) {
                if (arr2[i] >= 750) {
                    System.out.print(
                        "\nEnter Coding Test score of UID "
                        + ar[i] + ": ");
                    s2[i] = sc.nextDouble();
                }
            }
        }
        System.out.print(
            "\nEnter Coding test Scores for Amazon:");
        for (int i = 0; i < n; i++) {
            if (arr1[i] >= 8.00) {
                if (arr2[i] >= 700) {
                    System.out.print(
                        "\nEnter Coding Test score of UID "
                        + ar[i] + ": ");
                    s3[i] = sc.nextDouble();
                }
            }
        }
  
        System.out.println(
            "\nStudents eligible to sit for Google interview ");
        System.out.print(
            "UID\t\t\tName\t\t\tCGPA\t\tAMCAT\n");
        for (int i = 0; i < n; i++) {
            if (arr1[i] >= 7.00) {
                if (arr2[i] >= 600) {
                    if (s1[i] > 80) {
                        System.out.printf(
                            "%-12s%-16s%-12f%-6d\n", ar[i],
                            arr[i], arr1[i], arr2[i]);
                    }
                }
            }
        }
  
        System.out.println(
            "\nStudents eligible to sit for Microsoft interview ");
        System.out.print(
            "UID\t\t\tName\t\t\tCGPA\t\tAMCAT\n");
        for (int i = 0; i < n; i++) {
            if (arr1[i] >= 7.50) {
                if (arr2[i] >= 750) {
                    if (s1[i] > 70) {
                        System.out.printf(
                            "%-12s%-16s%-12f%-6d\n", ar[i],
                            arr[i], arr1[i], arr2[i]);
                    }
                }
            }
        }
        System.out.println(
            "\nStudents eligible to sit for Amazon interview ");
        System.out.print(
            "UID\t\t\tName\t\t\tCGPA\t\tAMCAT\n");
        for (int i = 0; i < n; i++) {
            if (arr1[i] >= 8.00) {
                if (arr2[i] >= 700) {
                    if (s1[i] > 80) {
                        System.out.printf(
                            "%-12s%-16s%-12f%-6d\n", ar[i],
                            arr[i], arr1[i], arr2[i]);
                    }
                }
            }
        }
    }
}

Here the output is generic which represent the list of students who are eligible for appearing in the interviews as custom inputs is been interpreted in illustration part above.

Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more,  please refer Complete Interview Preparation Course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :