Wednesday, 19 October 2016

PROGRAMME FOR MARKS,PERCENTAGE AND GRADE

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float a,m,c,p,e,k,o;
int xy;
cout<<"enter the marks obtained in maths\n";
cin>>m;
cout<<"enter the marks obtained in physics\n";
cin>>p;
cout<<"enter the marks obtained in chemistry\n";
cin>>c;
cout<<"enter the marks obtained in english\n";
cin>>e;
cout<<"enter the marks obtained in computer science\n";
cin>>k;
a=(m+p+c+e+k)/5;
cout<<"the average marks will be\n"<<a<<"\n";
o=5*a*0.5;
cout<<"the overall percentage achieved will be\n"<<o<<"\n";
cout<<"1.If overall percentage is => 90\n";
cout<<"2.If overall percentage is between 89-80\n";
cout<<"3.If overall percentage is between 79-70\n";
cout<<"4.If overall percentage is between 69-60\n";
cout<<"5.If overall percentage is between 59-50\n";
cout<<"6.If overall percentage is < 50\n";
cout<<"enter your choice\n";
cin>>xy;
switch(xy)
{
case 1:
cout<<"the grade awarded will be\n"<<"A";
break;
case 2:
cout<<"the grade awarded will be\n"<<"B";
break;
case 3:
cout<<"the grade awarded will be\n"<<"C";
break;
case 4:
cout<<"the grade awarded will be\n"<<"D";
break;
case 5:
cout<<"the grade awarded will be\n"<<"E";
break;
case 6:
cout<<"ohhh nooo...............FAIL";
break;
default:
cout<<"the entered category is invalid";
break;
}
getch();
}

No comments:

Post a Comment