a. Read in the student's name, midterm grade, minor B, and final exam ratings.
b. Determine the final grade of the student by formula:
final grade = 0.30 of midterm grade + 0.10 of minor B + 0.60 of final exam.
c. Determine the equivalent grade for the numerical value obtained by the following grading marks:
98 - 100 = 4.00
95 - 97 = 3.75
92 - 94 = 3.50
89 - 91 = 3.25
86 - 88 = 3.00
83 - 85 = 2.75
80 - 82 = 2.50
77 - 79 = 2.25
74 - 76 = 2.00
71 - 73 = 1.75
68 - 70 = 1.50
64 - 67 = 1.25
60 - 63 = 1.00
below 60= 0.00
#include<stdio.h>
#include<conio.h>
#define min printf
#define jee scanf
int main()
{
int mg, mb, fe;
float fg;
char sn;
min("Enter student's name: ");
jee("%s",&sn);
min("Enter midterm grade: ");
jee("%d",&mg);
min("Enter minor B: ");
jee("%d",&mb);
min("Enter final exam: ");
jee("%d",&fe);
fg = ( mg * .30 ) + ( mb * .10 ) + ( fe * .60 );
min("Your final grade is %.2f or equivalent to ",fg);
if( fg >= 98 && fg <= 100)
{
min("4.00");
}
else
if( fg >= 95 && fg <= 97)
{
min("3.75");
}
else
if( fg >= 92 && fg <= 94)
{
min("3.50");
}
else
if( fg >= 89 && fg <= 91)
{
min("3.25");
}
else
if( fg >= 86 && fg <= 88)
{
min("3.00");
}
else
if( fg >= 83 && fg <= 85)
{
min("2.75");
}
else
if( fg >= 80 && fg <= 82)
{
min("2.50");
}
else
if( fg >= 77 && fg <= 79)
{
min("2.25");
}
else
if( fg >= 74 && fg <= 76)
{
min("2.00");
}
else
if( fg >= 71 && fg <= 73)
{
min("1.75");
}
else
if( fg >= 68 && fg <= 70)
{
min("1.50");
}
else
if( fg >= 64 && fg <= 67)
{
min("1.25");
}
else
if( fg >= 60 && fg <= 63)
{
min("1.00");
}
else
{
min("0.00");
}
getch ();
return 0;
}
Sample Output:
▌▌▌Ü ▌▌▌
Walang komento:
Mag-post ng isang Komento