0% found this document useful (0 votes)
7 views1 page

DH

The document is a C program that calculates a final grade based on exam scores, assignment scores, and attendance percentage. It prompts the user for input, computes the final grade using a weighted formula, and assigns a letter grade based on the final score. The program uses conditional statements to determine the letter grade from A to F.

Uploaded by

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

DH

The document is a C program that calculates a final grade based on exam scores, assignment scores, and attendance percentage. It prompts the user for input, computes the final grade using a weighted formula, and assigns a letter grade based on the final score. The program uses conditional statements to determine the letter grade from A to F.

Uploaded by

dieumsiehamuli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

#include <stdio.

h>

int main() {

int Examscore,Assignmentscore, Attendancepercentage, finalgrade, lettergrade;

printf("Enter Exam score (out of 100):");

scanf("%f",&Examscore);

printf("Enter Assignment score (out of 50):");

scanf("%f",&Assignmentscore);

printf("Enter Attendance percentage (out of 100:");

scanf("%f",&Attendancepercentage);

finalgrade=(0.6*Examscore)+(0.3*Assignmentscore)+(0.1*Attendancepercentage);

if (finalgrade>=90 && finalgrade<=100) {

printf ("lettergrade: A\n");

} else if (finalgrade>=80 && finalgrade<=89) {

printf ("lettergrade: B\n");

} else if (finalgrade>=70 && finalgrade<=79) {

printf ("lettergrade: C\n");

} else if (finalgrade>=60 && finalgrade<=69) {

printf ("lettergrade: D\n");

} else {

printf("lettergrade: F\n");

return 0;

You might also like