------------------------------------------------------------
Screen Layout
Turbo c program that uses math operation and operator precedence rule to compute the term grade and semestral grade based on the user's input for quizzes, class standing, term exam.
Formula for computation:
Equivalent per term - Total grade
Quizzes - 30% Prelim - 30%
Class Standing - 30% Midterm - 30%
Exam - 40% Final - 40%
------------ -------------
100% 100%
Click Read More for the code:
#include<conio.h>
#include<stdio.h>
#define g gotoxy
#define p printf
#define s scanf
main()
{int num1,num2,num3,num4,num5,num6,num7,num8,num9,num10,num11,num12,sum1,sum2,sum3,sum;
float num13=.30,num14=.40;
clrscr();
g(5,2);p("My SImple Grading System");
g(5,3);p("------------------------");
g(5,5);p("Prelim");
g(5,6);p("Q1:");
g(5,7);p("Q2:");
g(5,8);p("CS:");
g(5,9);p("Exam:");
g(15,5);p("Midterm");
g(15,6);p("Q1:");
g(15,7);p("Q2:");
g(15,8);p("CS:");
g(15,9);p("Exam:");
g(30,5);p("Final");
g(30,6);p("Q1:");
g(30,7);p("Q2:");
g(30,8);p("CS:");
g(30,9);p("Exam:");
g(2,10);p("----------------------------------------");
g(8,6);s("%d",&num1);
g(8,7);s("%d",&num2);
g(8,8);s("%d",&num3);
g(11,9);s("%d",&num4);
g(18,6);s("%d",&num5);
g(18,7);s("%d",&num6);
g(18,8);s("%d",&num7);
g(21,9);s("%d",&num8);
g(33,6);s("%d",&num9);
g(33,7);s("%d",&num10);
g(33,8);s("%d",&num11);
g(36,9);s("%d",&num12);
sum=(((num1+num2)/2)*num13)+(num3*0.30)+(num4*num14);
g(5,13);p("Term Grade:");
g(5,14);p("Semestral Grade:");
sum1=(((num5+num6)/2)*num13)+(num7*num13)+(num8*num14);
g(18,13);p("%d",sum);
sum2=(((num9+num10)/2)*num13)+(num11*num13)+(num12*num14);
g(24,13);p("%d",sum1);
g(29,13);p("%d",sum2);
sum3=(sum*num13)+(sum1*num13)+(sum2*num14);
g(25,14);p("%d",sum3);
getch();
return 0;
}
No comments:
Post a Comment