Knowee
Questions
Features
Study Tools

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)

Question

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)

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

Solution

Here is a simple implementation of the Student Record Management System in C:

#include <stdio.h>

typedef struct {
    char name[50];
    int roll;
    int marks[5];
} Student;

int main() {
    int i, j, n;
    float avg, total = 0;

    printf("Enter the number of students: ");
    scanf("%d", &n);
    Student students[n];

    for(i=0; i<n; i++) {
        printf("Enter details for student %d:\n", i+1);
        printf("Name: ");
        scanf("%s", students[i].name);
        printf("Roll Number: ");
        scanf("%d", &students[i].roll);
        printf("Marks in 5 subjects:\n");
        for(j=0; j<5; j++) {
            printf("Subject %d: ", j+1);
            scanf("%d", &students[i].marks[j]);
            total += students[i].marks[j];
        }
    }

    avg = total / (n*5);

    printf("Class average marks: %.2f\n", avg);
    printf("Students scoring above average:\n");
    for(i=0; i<n; i++) {
        float student_avg = 0;
        for(j=0; j<5; j++) {
            student_avg += students[i].marks[j];
        }
        student_avg /= 5;
        if(student_avg > avg) {
            printf("%s (Roll Number: %d)\n", students[i].name, students[i].roll);
        }
    }

    printf("Students scoring below average:\n");
    for(i=0; i<n; i++) {
        float student_avg = 0;
        for(j=0; j<5; j++) {
            student_avg += students[i].marks[j];
        }
        student_avg /= 5;
        if(student_avg < avg) {
            printf("%s (Roll Number: %d)\n", students[i].name, students[i].roll);
        }
    }

    return 0;
}

This program first asks for the number of students. Then it asks for the details of each student, including their name, roll number, and marks in 5 subjects. It calculates the average marks of the class and then prints the names and roll numbers of the students who scored above and below the average.

This problem has been solved

Similar Questions

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.

Create a class called "Student" with private member variables for name, roll number, and marks in three subjects. Include public member functions to set the student details, calculate the average marks, and display the student detail

We want to calculate the total marks of each student of a class in Physics,Chemistry and Mathematics and the average marks of the class. The number of students in the class are entered by the user. Create a class named Marks with data members for roll number, name and marks. Create three other classes inheriting the Marks class, namely Physics, Chemistry and Mathematics, which are used to define marks in individual subject of each student. Roll number of each student will be generated automatically using inheritance by c++

Write a C program to compute the maximum marks and average marks of a class using sentinel controlled repetition (-1 as the sentinel value)?- If user enters negative marks then display INVALID INPUT and and read the marks again.- If number of students is 0, then display "NO DATA"- If number of students > 0, then display maximum marks and the average marks separated by space.-You can assume that marks are integers and average also you discard decimal value.

Create a class VIT with data members student roll no, name, marks define a constructor to initilize the data members create a derived class student ,define a member function to calculate the average mark of the student

1/3

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.