Tuesday, 31 July 2018

Stream Calculator

===========================================================================
                                CODING



#include<iostream.h>
#include<conio.h>
#include<math.h>

void main()
{
clrscr();
float p,o,i,u,y,t;
char l[20],grade;
cout<<"Enter Your NAME: ";
cin>>l;
cout<<"\n Enter marks of Maths (out of 100) : ";
cin>>p;
cout<<"\n Enter marks of English (out of 100) : ";
cin>>o;
cout<<"\n Enter marks of Sanskrit (out of 100) : ";
cin>>i;
cout<<"\n Enter marks of Science (out of 100) : ";
cin>>u;
cout<<"\n Enter marks of Social Science (out of 100) : ";
cin>>y;
t=(p+o+i+u+y)/5;
if(t>0 && t<=30)
{grade='F';
cout<<"\n"<<l<<" sorry you are Fail!!!! go study";}
else if(t>30 && t<=60)
{grade='E';
cout<<"\n"<<l<<" your grade is \"E\" need to work hard";}
else if(t>60 && t<=70)
{grade='D';
cout<<"\n"<<l<<" your grade is \"D\" go home and get lost";}
else if(t>70 && t<=80)
{grade='C';
cout<<"\n"<<l<<" your grade is \"C\" go home and get lost";}
else if(t>80 && t<=90)
{grade='B';
cout<<"\n"<<l<<" your grade is \"B\" go home and get lost";}
else if(t>90 && t<=100)
{grade='A';
cout<<"\n"<<l<<" your grade is \"A!!\" ";}
else
{grade='G';
cout<<"\nWrong Input";}
switch(grade)
{
case 'A': cout<<"\n"<<l<<" you are eligible for Art"; break;
case 'B': cout<<"\n"<<l<<" you are eligible for Commerce"; break;
case 'C': cout<<"\n"<<l<<" you are eligible for Dance"; break;
case 'D': cout<<"\n"<<l<<" you are eligible for Majduri"; break;
case 'E': cout<<"\n"<<l<<" you are eligible for Kheti"; break;
case 'F': cout<<"\n"<<l<<" you are eligible for Nothing"; break;
default : cout<<"....";
}
getch();
}


===========================================================================


                                OUTPUT



No comments:

Post a Comment