#include<iostream.h>
void main()
{
int q1,q2,q3,q4,q5,q6; int A1,A2,A3,A4,A5;
int *ptr;
{
cout<<"\nxxxxQuizzesxxxx";
//best quizzes situation choose best of the 4
cout<<"\nEnter the 5 quizzes marks = ";
cin>>q1>>q2>>q3>>q4>>q5;
{
if(q1<q2 && q1<q3 && q1<q4 && q1<q5)
{
q6=q2+q3+q4+q5;
ptr=&q6;
}
else if(q2<q1 && q2<q3 && q2<q4 && q2<q5)
{
q6=q1+q3+q4+q5;
ptr=&q6;
}
else if(q3<q1 && q3<q2 && q3<q4 && q3<q5)
{
q6 = q1+q2+q4+q5;
ptr = &q6;
}
else if(q4<q1 && q4<q2 && q4<q3 && q4<q5)
{
q6 = q1+q2+q3+q5;
ptr = &q6;
}
else if(q5<q1 && q5<q2 && q5<q4 && q5<q3)
{
q6 = q1+q2+q3+q4;
ptr = &q6;
}
}
cout<<"\n best of the 4 quizzes marks are as under = "<<q6;
}
{
{
cout<<"\nxxxxAssignemntsxxxx";
//best Assignemts situation choose best of the 4
cout<<"\n\nEnter the 4 Assignments marks are = ";
cin>>A1>>A2>>A3>>A4;
{
if(A1<A2 && A1<A3 && A1<A4)
{
A5=A2+A3+A4;
ptr=&A5;
}
else if(A2<A1 && A2<A3 && A2<A4 )
{
A5=A1+A3+A4;
ptr=&A5;
}
else if(A3<A1 && A3<A2 && A3<A4)
{
A5 = A1+A2+A4;
ptr = &A5;
}
else if(A4<A1 && A4<A2 && A4<A3)
{
A5 = A1+A2+A3;
ptr = &A5;
}
}
cout<<"\n best of the 3 Assignents marks are as under = "<<A5;
}
//to get the 20% weightage
q6 = (q6/2);
// to gett the 10% weigtage of the assignments then
A5 = (A5/3);
}
cout<<"\nSo the average best of against the 10% of assignment is = "<< A5;
cout<<"\nSo the average best of against the 20% of Quizes is = "<< q6;
float mid;
float final;
cout<<"\nxxxxMid Teremxxxx";
cout<<"\nPlease Enter the mid term marks = "; cin>>mid;
cout<<"\nxxxxFinal Termxxxx";
cout<<"\nPlease Enter the Final term marks = "; cin>>final;
cout<<"\nxxxxCalculationsxxxx";
float totl=A5+q6+mid+final;
cout<<"\n\nYour Total Marks in subject are as under = "<<totl;
if(totl>=86 && totl<=100){cout<<"You got A grade";}
else if(totl>=78 && totl<=85){cout<<"You got B+ grade";}
else if(totl>=72 && totl<=77){cout<<"You got B grade";}
else if(totl>=66 && totl<=71){cout<<"You got C+ grade";}
else if(totl>=60 && totl<=65){cout<<"You got C grade";}
else if(totl>=50 && totl<=60){cout<<"You got C grade";}
else if(totl>=0 && totl<=49){cout<<"You are Fail ";}
else{cout<<"\nWrong marks result error ,try again thnx ";}
}