Knowee
Questions
Features
Study Tools

A job opening for the position of Junior Engineer in the Telecommunication department has been advertised in the newspaper. To qualify for the post, applicants are required to take a written examination in M subjects. The department has released the marks of N applicants in these M subjects.To be eligible for an interview, applicants must score 50 or more in each subject. If an applicant scores less than 50 in any subject, they will not be eligible for an interview.Your task is to write a C program to read the 2D array of marks of N applicants in M subjects.Pass the array to the user-defined function that will perform the following:For the "Eligible" applicants, print the sum of marks in M subjects.For the “Not Eligible” applicants print -1Sample Input2 (N-Read the total number of applicants)3(M-Read the total number of subjects)50 60 7076 82 34Sample OutputApplicant 1 180 EligibleApplicant 2 -1 Not Eligible

Question

A job opening for the position of Junior Engineer in the Telecommunication department has been advertised in the newspaper. To qualify for the post, applicants are required to take a written examination in M subjects. The department has released the marks of N applicants in these M subjects.To be eligible for an interview, applicants must score 50 or more in each subject. If an applicant scores less than 50 in any subject, they will not be eligible for an interview.Your task is to write a C program to read the 2D array of marks of N applicants in M subjects.Pass the array to the user-defined function that will perform the following:For the "Eligible" applicants, print the sum of marks in M subjects.For the “Not Eligible” applicants print -1Sample Input2 (N-Read the total number of applicants)3(M-Read the total number of subjects)50 60 7076 82 34Sample OutputApplicant 1 180 EligibleApplicant 2 -1 Not Eligible

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

Here is a simple C program that accomplishes the task:

#include <stdio.h>

void checkEligibility(int marks[][3], int n, int m) {
    for(int i=0; i<n; i++) {
        int sum = 0;
        int eligible = 1;
        for(int j=0; j<m; j++) {
            if(marks[i][j] < 50) {
                eligible = 0;
                break;
            }
            sum += marks[i][j];
        }
        if(eligible) {
            printf("Applicant %d %d Eligible\n", i+1, sum);
        } else {
            printf("Applicant %d -1 Not Eligible\n", i+1);
        }
    }
}

int main() {
    int n = 2;
    int m = 3;
    int marks[2][3] = {{50, 60, 70}, {76, 82, 34}};
    checkEligibility(marks, n, m);
    return 0;
}

This program first defines a function checkEligibility that takes a 2D array of marks, and the number of applicants and subjects. It then iterates over each applicant, and for each applicant, it calculates the sum of their marks and checks if they are eligible (i.e., if they scored 50 or more in each subject). If the applicant is eligible, it prints their sum of marks, otherwise it prints -1. The main function then tests this function with a sample input.

This problem has been solved

Similar Questions

Single File Programming QuestionPlacement EligibilityA company, ABC Corp, has set specific eligibility criteria for its internship program. Applicants must have a minimum Grade Point Average (GPA) of 6.0 and must score at least 50.5 in the initial screening test. Write a program to determine if a student qualifies for the internship based on these criteria.Note: Use the Nested ternary operator.Input format :The first line of input consists of an integer m, representing the CGPA value.The second line of input consists of floating point number s, representing the initial screening test score.Output format :The output prints either "Eligible for Next Round", "Not Eligible" or "Try again..." based on the conditions.Refer to the sample output for the formatting specifications.Code constraints :In the given scenario, the test cases fall under the following constraints:4 ≤ m ≤ 1020.0 ≤ s ≤ 100.0Sample test cases :Input 1 :786.1Output 1 :Eligible for Next RoundInput 2 :460.1Output 2 :Not EligibleInput 3 :734.1Output 3 :Try again...Input 4 :10100.0Output 4 :Eligible for Next RoundNote :The program will be evaluated only after the “Submit Code” is clicked.Extra spaces and new line characters in the program output will result in the failure of the test case.

Imagine you are a teacher in a programming class, and you want to create a simple program to manage and analyze the scores of your students. Your task is to develop a C program that performs basic operations on an array representing the students' scores. The program will help you quickly view, analyze, and update the scores. Here's a breakdown of the tasks:1. Initialize Array:o Declare an array named studentScores to store the scores of 5 students in your programming class.o Initialize the array with random scores between 50 and 100 to represent their performance in a recent assignment.2. Display Scores:o Implement a function named displayScores that takes the array of scores and its size as parameters. This function should display the scores of each student, allowing you to easily check the performance distribution in the class.3. Calculate Average:o Implement a function named calculateAverage to calculate and return the average score of the students. This will help you understand the overall performance of the class.4. Find Highest Score:o Implement a function named findMaxScore that finds and returns the highest score in the array. Knowing the highest score will give you an idea of the best-performing student.5. Update Scores:o Implement a function named updateScores to increment each student's score by 5. This simulates a bonus or extra credit being added to the assignment.6. Main Function:o In the main function, initialize the array with scores, display the initial scores, calculate and display the average, find and display the highest score, update the scores, and finally, display the updated scores.

You are developing a Student Record Management System in C. The system needs to store and manage information for multiple students, including their names, roll numbers, and marks obtained in different subjects. Implement array in structures to read, write, and compute average marks and the students scoring above and below the average marks for a class of N students. INPUT/OUTPUT EXAMPLE: Enter the number of students: 3 Enter details for 3 students: Student 1: Name: A Roll Number: 1 Marks in 5 subjects: Subject 1: 12 Subject 2: 13 Subject 3: 14 Subject 4: 15 Subject 5: 16 Student 2: Name: BB Roll Number: 2 Marks in 5 subjects: Subject 1: 11 Subject 2: 13 Subject 3: 12 Subject 4: 15 Subject 5: 14 Student 3: Name: CC Roll Number: 10 Marks in 5 subjects: Subject 1: 13 Subject 2: 14 Subject 3: 16 Subject 4: 17 Subject 5: 11 Class average marks: 13.73 Students scoring above average: A (Roll Number: 1) CC (Roll Number: 10) Students scoring below average: BB (Roll Number: 2)

Single File Programming QuestionProblem StatementAryan, a recruiter, requires a program to screen candidates for a fitness program. The program must accommodate input from a specified number of candidates, denoted by N. For each candidate, four distinct values should be entered: age (an integer), height (a float), weight (an integer), and chest size (an integer). The program's objective is to evaluate these candidates against certain eligibility criteria. Once the evaluation is complete, it should display the indices (using 0-based indexing) of those candidates who meet the specified eligibility criteria. Age should be greater than 18 and less than 25Height between 5.7 and 6.0 feet (both inclusive).Weight between 45 and 60 kg (both inclusive).Chest size greater than 45 inches.Input format :The first line consists of an integer N, representing the number of candidates.The next N lines consist of four space-separated values, representing age (an integer), height (float), weight (an integer), and chest size (an integer).Output format :If there are eligible candidates, print space-separated indices of those candidates.If no eligible candidates are found, print -1.Refer to the sample output for the formatting specifications.Code constraints :In the given scenario, the test cases fall under the following constraints:1 ≤ N ≤ 1018 ≤ age ≤ 255.7 ≤ height ≤ 6.045 ≤ weight ≤ 60chest size > 45Sample test cases :Input 1 :522 5.8 48 5415 5.8 40 5224 5.8 48 56 12 5.2 45 6020 5.9 55 48Output 1 :0 2 4 Input 2 :218 3.8 38 3819 5.5 45 45Output 2 :-1Input 3 :1022 5.8 48 5415 5.8 40 5224 5.8 48 5612 5.2 45 6020 5.9 55 4819 5.7 46 4823 6.0 52 5018 5.6 42 4825 5.8 50 4621 6.1 60 55Output 3 :0 2 4 6

Write a C program using structure student which allows users to input details for three students including their names, roll numbers, and marks in 5 subjects. Use a function calculateTotalMarks(struct Student) which calculates the total marks and percentage for each student and displays the information. Each subject test is for 10 marks. Total marks = 50. Percentage = (marks obtained/total marks)*100.

1/2

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.