0% found this document useful (0 votes)
76 views4 pages

PPS Mini Project

Uploaded by

shaikhirfant.0
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)
76 views4 pages

PPS Mini Project

Uploaded by

shaikhirfant.0
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/ 4

Project Title: Student Grade Calculator

Description:
This project will create a program that calculates the Total marks,
average grade of a student based on their marks in different subjects.
Features:
• Input:
o The program will prompt the user to enter the number of subjects.
o The user will then be asked to enter the marks obtained in each
subject.
• Calculation:
o The program will calculate the total marks obtained.
o The program will calculate the average marks.
• Output:
o The program will display the total marks obtained by the student.
o The program will display the average marks obtained by the
student.
o The program will display the grade of the student based on the
average marks (e.g., A+, A, B+, B, etc.). You can define your own
grading system.

Learning Objectives:
• Variables and data types (int, float)
• Arrays
• Input/output using scanf and printf
• Loops (for loop)
• Conditional statements (if-else)
• Basic arithmetic operations
C Code:

#include <stdio.h>

int main() {
int num_subjects, i;
float marks[100], total_marks = 0, average;

printf("Enter the number of subjects: ");


scanf("%d", &num_subjects);

printf("Enter marks obtained in each subject:\n");


for (i = 0; i < num_subjects; i++) {
printf("Subject %d: ", i + 1);
scanf("%f", &marks[i]);
total_marks += marks[i];
}

average = total_marks / num_subjects;

printf("\nTotal Marks: %.2f\n", total_marks);


printf("Average Marks: %.2f\n", average);
// Define your grading scale here
if (average >= 90) {
printf("Grade: A+\n");
} else if (average >= 80) {
printf("Grade: A\n");
} else if (average >= 70) {
printf("Grade: B+\n");
} else if (average >= 60) {
printf("Grade: B\n");
} else if (average >= 50) {
printf("Grade: C\n");
} else {
printf("Grade: F\n");
}

return 0;

Output:
• Display the total marks, average marks, and the corresponding
grade to the user.
Explanation:
• The code starts by including the stdio.h header for
input/output operations.
• It then declares variables to store the number of subjects,
marks, total marks, average marks, and the grade.
• The user is prompted to enter the number of subjects and the
marks obtained in each subject.
• The code calculates the total and average marks.
• Based on the average marks, the grade is determined using if-
else statements.
• Finally, the total marks, average marks, and the grade are
displayed to the user.

Conclusion:
This simple project demonstrates the use of basic C programming
concepts such as:
• Variable declaration and initialization
• Input/output operations using scanf and printf
• Arrays to store multiple values
• Loops for iteration
• Conditional statements (if-else) for decision-making

You might also like