Wednesday, July 23, 2008
using namespace std;
int main()
{
char grade;
int i;
double quiz[8], lab[4], mst, gp, qans, lans, mans, tans, target;
//input
for (i=0; i<8; i++)
{
cout << "Enter marks for Weekly Quiz " << i+1 << ": ";
cin >> quiz[i];
}
for (i=0; i<4; i++)
{
cout << "Enter marks for Lab Test " << i+1 << ": ";
cin >> lab[i];
}
cout << "Enter marks for MST: ";
cin >> mst;
cout << "Enter marks for GP: ";
cin >> gp;
//computation
//quiz ans
qans=0;
for (i=0; i<8; i++)
qans+=quiz[i];
qans=qans/0.25;
//lab ans
lans=0;
for (i=0; i<4; i++)
lans+=lab[i];
lans=lans*0.15;
mans=mst/5;
tans=qans+lans+mans+gp;
//output
if (tans>=80)
grade='A';
else if (tans<80 && tans>=70)
grade='B';
else if (tans<70 && tans>=60)
grade='C';
else if (tans<60 && tans>=55)
grade='D';
else if (tans<55 && tans>=50)
grade='E';
else
grade='F';
cout << "\nGrade: " << grade << endl;
//computation
if (tans>=80)
cout << "You already have an A grade." << endl;
else if (tans<80 && tans>=65)
{
target=(80-tans)/60*100;
cout << "You need to score " << target << "marks for your lab test4 to get an A grade." << endl;
}
else
cout << "You cannot get an A grade even if you score full marks." << endl;
return 0;
}
This one marcus de...=D
Mine dont know why cannot post...=P
Hs...
; tortured on 10:10 PM =/
__________________________________
the1B02
ONE class of FIFTEEN gentlemen and FIVE ladies
average age of SEVENTEEN
first met each other on 8th apr 08 at T1442
we are
environmental friendly
theCREWS
Designer: no idea
Code Edited: abigail/han sheng
Picture: photobucket
Host: blogger::
photobucket
Thanks: blogskins
click THIS: ♥
thecopyCATS
this blog was created by HANSHENG.
the templater was ABIGAIL.
blogskin found by JESSLE.
you are NOT ALLOWED to copy or take anything from HERE. trespassers WILL be prosecuted.