0% found this document useful (0 votes)
7 views7 pages

Aditya

This document outlines a project for a C Programming course as part of a Bachelor of Business Administration, Computer Application, or Commerce program. The project involves creating a Student Report System to manage student details, calculate percentages and grades, and display information such as the top student and those with less than 50% marks. The document includes code snippets for the implementation of the system and details about the student submitting the project.

Uploaded by

namanr073
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views7 pages

Aditya

This document outlines a project for a C Programming course as part of a Bachelor of Business Administration, Computer Application, or Commerce program. The project involves creating a Student Report System to manage student details, calculate percentages and grades, and display information such as the top student and those with less than 50% marks. The document includes code snippets for the implementation of the system and details about the student submitting the project.

Uploaded by

namanr073
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

PROGRAM: BACHELOR OF BUSINESS ADMINISTRATION/

BACHELOR OF COMPUTER APPLICATION/


BACHELOR OF COMMERCE

Subject C Programming
Subject Code BCA - 202
Batch 2023-2026
Session 2024-2025
Semester II
Section C

Project No. 1

Student Report System


Project title

Aditya kumar jha


Student’s Name

Student’s Enrollment No. ASB/BCA/23/090

Student’s Signature*

Submission Date 11-03-2024


Due Date 11-03-2024
Faculty Name Ms. Suvidha Agarwal
Marks Assigned by the Faculty

Signature of Faculty

Comments by the Faculty:

*By signing the above you attest that you have contributed to this submission and confirm that all work you
have contributed to this submission is your own work. Any suspicion of copying or plagiarism in this work
will result in an investigation of Academic Misconduct and may result in a “0” on the work, or
possibly more severe penalties, as well as a Disciplinary Notice on your academic record.
AIM: Create a Report Card for class 12th of ASB School, Noida.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_STUDENTS 50
#define SUBJECTS 5

typedef struct {
char name[50];
float marks[SUBJECTS];
float percentage;

char grade;
} Student;

void calculatePercentageAndGrade(Student *student) {


float total = 0;
for (int i = 0; i < SUBJECTS; i++) {
total += student->marks[i];

}
student->percentage = (total / SUBJECTS);

if (student->percentage >= 90) {


student->grade = 'A';
} else if (student->percentage >= 80) {
student->grade = 'B';
} else if (student->percentage >= 70) {
student->grade = 'C';
} else if (student->percentage >= 60) {
student->grade = 'D';
} else {
student->grade = 'F';
}
}

void printStudentDetails(Student student) {


printf("Name: %s\n", student.name);
printf("Percentage: %.2f\n", student.percentage);
printf("Grade: %c\n", student.grade);
}

void printTopper(Student students[], int n) {


int maxIndex = 0;

for (int i = 1; i < n; i++) {


if (students[i].percentage > students[maxIndex].percentage) {
maxIndex = i;

}
}
printf("Topper Details:\n");
printStudentDetails(students[maxIndex]);
}

void printBelow50Percent(Student students[], int n) {


printf("Students with percentage less than 50%%:\n");
for (int i = 0; i < n; i++) {
if (students[i].percentage < 50) {
printStudentDetails(students[i]);
printf("\n");
}
}
}

int main() {
int n;
printf("Enter the number of students: ");
scanf("%d", &n);
if (n > MAX_STUDENTS) {
printf("Maximum number of students allowed is %d\n", MAX_STUDENTS);
return 1;
}

Student students[n];

for (int i = 0; i < n; i++) {


printf("\nEnter details for Student %d:\n", i + 1);
printf("Enter name: ");
scanf("%s", students[i].name);
for (int j = 0; j < SUBJECTS; j++) {
printf("Enter marks in Subject %d: ", j + 1);
scanf("%f", &students[i].marks[j]);

}
calculatePercentageAndGrade(&students[i]);
}

int choice;
printf("\nMenu:\n");
printf("1. Search student details\n");
printf("2. Print details of the topper\n");
printf("3. Students with percentage less than 50%%\n");
printf("Enter your choice: ");
scanf("%d", &choice);

switch (choice) {
case 1: {

char searchName[50];
printf("\nEnter the name of the student you want to search: ");
scanf("%s", searchName);
int found = 0;
for (int i = 0; i < n; i++) {
if (strcmp(students[i].name, searchName) == 0) {
printf("Student found!\n");
printStudentDetails(students[i]);
found = 1;
break;
}
}
if (!found) {
printf("Student not found!\n");
}
break;
}
case 2:
printTopper(students, n);
break;

case 3:
printBelow50Percent(students, n);
break;
default:
printf("Invalid choice!\n");
}

return 0;
}
Output:

You might also like